msbuild.exe is not recognized command after build in Jenkins
For the latest version of jenkins (3.0), you have to configure MSBuild in in the Tools>Manage Jenkins
menu. Name a job here eg: msbuild
.
Once that is done, go to the job. Under the MSBuild module select the build (in this case msbuild
) and now kick off the job. You should be good to go.
For the newer version of Jenkins, this option is available under this section ..
Manage Jenkins -> Global Tool Configuration -> MSBuild
From this answer: https://stackoverflow.com/a/37939483/2880781
If you want to build a .NET project using Jenkins, follow these steps:
Install MsBuild Plugin
Go to
Jenkins -> Manage Jenkins -> Configure System
(On newer versions:Jenkins -> Manage Jenkins -> Global Tool Configuration -> MSBuild
)In the MSBuild section click the AddMsBuild button and specify the details:
- Name: Name of the MsBuild
- Path to MsBuild: Specify the path of msbuild.exe. Example:
C:\Windows\Microsoft.NET\Framework\v3.5\msbuild.exe
Save and apply the changes.
Select your job.
Select Add Build Step.
Select MsBuild version.
Specify the path to the project file (.csproj or .sln)
- Build your project.