I am trying to create a VS.SLN that has several C ++. Vcproj in it. The solution file is generated using CMake, and this part works in Jenkins (with the CMake builder plugin). To create a solution file, I use msbuild. I can build the solution using Visual Studio and from the command line using the following command:
C:\Jenkins\workspace\SonioTest>"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" /t:Rebuild bin/SonIO.sln
It is being successfully built (on the same machine as Jenkins).
However, I am trying to automate this part of the assembly in Jenkins, and the assembly fails with C1083a couple of errors C1083( "Cannot open source file: '..\path\to\file.ext': No such file or directory). I tried to use both the Jenkins msbuild plugin and the same command that works in the terminal as the “Run Windows batch command” build step, with the same result.
When using the build step of a Windows batch command, I see in the log that the command is executing:
C:\Jenkins\workspace\SonioTest>"C:\Windows\Microsoft.NET\Framework\v4.0.30319 msbuild.exe" /t:Rebuild bin/SonIO.sln
... exactly the same as the one that works from the command line, including the working directory.
I use Jenkins as a service, and I have a service account as my account (with administrator privileges). Does anyone know which directory Jenkins will execute batch commands from?
Any idea why I can see this difference in behavior between Jenkins and the command line?
source
share