'Error MSB3073: MSBuild fails on pre-build step?

I have a pre-build step running in a visual studio project. The relevant chunk is this:

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <NMakeBuildCommandLine>cd "$(SolutionDir)pc-nrfutil\"
py -3.9 -O -m PyInstaller nrfutil.spec</NMakeBuildCommandLine>
    <NMakeCleanCommandLine>
    </NMakeCleanCommandLine>
    <NMakePreprocessorDefinitions>
    </NMakePreprocessorDefinitions>
    <OutDir>$(SolutionDir)pc-nrfutil\dist\</OutDir>
    <IntDir>$(SolutionDir)pc-nrfutil\build\</IntDir>
    <NMakeOutput>$(OutDir)nrfutil.exe</NMakeOutput>
  </PropertyGroup>

and here is the build command I use:

Invoke-MsBuild -Path .\production-support.sln -MsBuildParameters "/target:Build /property:Configuration=Release;Platform=x64 /verbosity:Detailed"

I have checked many, many different sources with this error code, but none of the solutions I found worked for me. Most of the other responses had something to do with either xcopy, or some fault in a filepath. Again, neither of these is really applicable in my case, hence why I'm asking here.

Here is the full error that I get when executing this build: Error log

Something I tried was removing the $(SolutionDir) call, and instead only having 'cd "pc-nrfutil"', but this resulted in the same error. Another thing of note is that when running my MSBuild command locally, the build succeeds. It is only when I run this through Jenkins that this error appears and the build fails, but I cannot fathom why that could happen.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source