Building ASP.NET Core 2.0 web applications

As I have mentioned in previous articles, I am using Team Foundation Services 2015 (TFS2015) to build our apps, and our latest ASP.NET Core 2.0 web app is no different. I’ve already run into the issue of versioning the app from the build process (which I have covered here[^]).

The next problem I ran into was getting the projects to build. By default TFS2015 will use the latest version of MSBUILD unless you specify a different version. For different, read earlier version i.e. VS2013, VS2012. To enable TFS2015 to build the project you need to specify the exact location of the version of MSBUILD you need to use. Thanksfully, TFS2015 gives you this option (under the Advanced tab on the MSBUILD task).

Before you can do this though, you need to install the Visual Studio 2017 SDK tools and APIs which will then install the required version of MSBUILD (which at the time of writing is version 15).

The next problem I ran into was executing the unit tests within our TFS2015 pipeline. The TFS2015 Visual Studio Test task wasn’t producing the required test output. I tried several tweaks and variations but none of them worked. After some reading around and looking at posts on Stackoverflow it was suggested that using the dotnet command-line tool would allow me to execute our unit tests. After some playing around with the various settings I eventually managed to get this working and finally able to publish our test results to the TFS2015 dashboard.

The biggest problem I have had so far is that I have really struggled to find solutions to the problems I have faced. This is due largely because .NET Core 2.0 is still (relatively) new. As the uptake increases I am sure many of these issues and problems will become better known and be addressed or have workarounds provided. That said, I’ve learned a great deal about how .NET Core 2.0 works under the covers because I’ve had to dig deep to find these solutions.

.NET Core 2.0 is a different beast to standard .NET in many ways, and each day I find one (or more) of these differences. It’s a pleasure to work with though, and is a genuinely fantastic environment in which to develop applications. A happy developer is a productive one

Image for post
Image for post

A father, cyclist, vegetarian, atheist, geek and multiple award winning technical author. Loves real ale, fine wine and good music. All round decent chap.

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