Integrate Jenkins With MSBuild

Many articles show how to set up Jenkins and MSBuild but what they miss is how to configure MSBuild in Jenkins.

Here I am showing how to integrate Jenkins with MSBuild. If you are new to Jenkins, please refer to this article to get the basics.

Let's log in into Jenkins as shown in the below screen. 
 From the left menu click in the Manage Jenkins tab,

It will show a list of items shown as per the below screen, from that list select Global Tool Configuration.


From the Global tool configurations, you can setup MSBuild Configuration.

Here, you have to copy the MSBuild.exe path from your system- Program files and paste it to Path to MSBuild textbox.

Give a name for your MSBuild and now, apply and save the changes.

Now, go to the New Item tab from the main menu, enter the Item name here I have given a name 'My Project'


Select a Freestyle project, click on ok.

Next, Navigate to the Build Environment tab as shown in the below screen, you can find the newly created MSBuild (MyMSBuild) from the MSBuild Version drop-down.


Here we have set up two parameters; you have to give your solution file path in MSBuild File text box and for release mode settings write:/p: Configuration=Release 

It will give output code in Release Any CPU Mode. 


Finally, click on apply and save to complete the configurations. If you want to implement how to setup .NET project build using Jenkins, please refer to this article.

I hope you like this article, in my next article we will see the master and slave concept in Jenkins.

Similar Articles