Creating Visual Studio Build using MSBuild and MSTest in Jenkins

In this article, we will see how to create a build for Visual Studio .Net project in Jenkins.

You will need to install below plugins before you can create a .Net build in Jenkins.

  1. MSBuild plugin for Jenkins
  2. MSTest plugin for Jenkins

I have already explained how to install plugins in Jenkins in earlier posts. Once you have installed above plugins, you will have to change below settings in Jenkins System.

Configure Jenkins system

Configure Jenkins system

MSBuild path configuration in Jenkins

MSBuild path configuration in Jenkins

MSTest path configuration in Jenkins

MSTest path configuration in Jenkins

Then you can create a new build project as explained in article on how to configure maven build in Jenkins.

SCM and Build trigger steps are similar for most of the projects. Now let us see how to add MSBuild and MSTest build tasks in .Net build.

MSBuild step in Jenkins

MSBuild step in Jenkins

MSTest build step in Jenkins

MSTest build step in Jenkins

Once .Net build configuration is saved, you can run the build from Jenkins Dashboard. Below image shows sample build log.

.Net build log in Jenkins

.Net build log in Jenkins

You may also like...