CI/CD using Jenkins and Dotnet

Please visit my website and subscribe to my youtube channel for more articles

https://devops4solutions.com/

This blog will help you setup the CI/CD with Jenkins & .NET.

Tools Used:

Install the MSBuild Plugin for Jenkins:

Manage Jenkins -> Manage Plugins -> Msbuild -> Install it

Image for post
Image for post

Configure MSBuild

Manage Jenkins — Global Tool Configuration ->

Path -> C:\Windows\Microsoft.NET\Framework\v4.0.30319 ( This is by default present if .net framework is installed don your machine). Check the path and version and accordingly put in the jenkins configuration.

Image for post
Image for post

MSBuild is successfully configured.

Now we will create a job in Jenkins

Image for post
Image for post

Add a build Step -> Execute Windows Batch Command ->nuget restore src/MyWindowsService/

Image for post
Image for post

Add another build step -> Build Visual Studio project -> src/MyWindowsService/MyWindowsService/Deploy-Windows-Service-Via-MSBuild.proj

Image for post
Image for post

Now save the project and trigger the build.

Image for post
Image for post

Check the Results

Open Services -> check whether the services got created as shown in the screenshot

Image for post
Image for post

Congratulations, finally you have setup a CI/CD with Jenkins & .NET.

Written by

Devops Automation Enginneer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store