Home > OS >  Jenkins doesn't recognize msbuild.exe
Jenkins doesn't recognize msbuild.exe

Time:12-09

I just started working with Jenkins and following this tutorial: enter image description here

C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin is also added to my Path variable and I have an msbuild system variable with the same value.

I don't know if it matters but I'm using Rider for IDE.

Does someone know why Jenkins can't find msbuild?

Thanks

CodePudding user response:

I assume you have Visual Studio 2019 installed. I suspect that the path is not correct. Use the vswhere command to find MSBuild. You can use the following command:

"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere" -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe

On a machine of mine with Visual Studio 2022 Community installed, the result is:

C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe

On Windows you can depend on vswhere being available at "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere", if Visual Studio 2017 or later is installed.

(vswhere is Windows only, is part of the Visual Studio Installer for Windows, and is not part of the .NET SDK.)

  • Related