5 Easy Steps to Setup a .Net Build Server on Windows 2016


.NET developers have the luxury of using Visual Studio to write code. In my opinion, Visual Studio is one of best IDE in the market today. When you build your applications inside Visual Studio, you are using MsBuild to compile your code.

In the past, setting up a .NET build server without installing Visual Studio was challenging. Now that Microsoft is releasing more software as open source  software, setting up a .NET build server can be accomplish with no issues.

In this post, I want to share the steps I took to setup a .Net continuous integration server running on Windows 2016.

First, launch a new instance with Windows 2016. I’m using AWS but any cloud provider would work as well.

After launching the new Windows 2016 server, it is time to install the necessary software to create our build server.

  1. Install Microsoft .NET Framework 4.5.2 Developer Pack.
  2. Install Microsoft .NET Framework 4.6.2 Developer Pack.
  3. Install Microsoft Build Tools 2015.
  4. Install Jenkins 2.19.3.
  5. Copy files from developers’ machine located at C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications to the same exact location on the new Windows 2016 server.

So far I have only tested this build server with a MVC website targeting .NET framework 4.5.2. Let me know if you run into any issues with this setup.

I hope to test different apps and also add support for .NET Core.

If you are using AWS, you can launch the same instance I have created by searching for “Jenkins Build Server 2.19.3”.

.Net C# Visual Studio

Read error messages

My friend, Bruce, was having issues building a software project. He tried different things to solve it but did not succeed. He spent hours with this problem. Since I was watching a soccer match, I didn’t take time to help him.

After the game was over, I took 5 minutes out of my busy schedule to see what the issue was.

He had a .Net solution that contained 12 projects and 1 of those projects refused to build. This project was a base project where other projects depended on to build the entire solution.

First, we tried to clean the solution but still refused to cooperate. Next, I asked Bruce to show me the subversion pending changes. He had a lot of pending changes but they were simple classes.

After that, we tried to build individual projects until we narrowed it down to 1 project. We knew that it failed to build but we did not see the actual error message.

I asked Bruce to display the output window and read the error message. The error message said, “unable to build project since it references another project with a higher .Net framework version.” Most of the projects in the solution were using version 4.0. Finally, we knew what the problem was. He updated all projects to use .Net framework version 4.5.2 to match the version of the library.

Build succedded.

After spending time with this issue, I came to the conclusion that reading the actual error message will eventually help you solve it.