Home > .Net Core, ASP.NET, Team Foundation Server, Visual Studio, vNext > Enabling CI for .net core using TFS Build

Enabling CI for .net core using TFS Build

At the moment there is no easy way to implement CI for .net core projects. Ideally it should be published and deployed to individual instances of nano servers, but that might be something beyond the capability of TFS Build.

Should you wish to implement CI for .net core projects on TFS 2015, here are the build steps and scripts that you need.

  1. Step 1: Install .net core
    Download https://docs.microsoft.com/en-us/dotnet/articles/core/tools/dotnet-install-script and either place it inside TFS or else in a central location. This will install and setup the .net Core CLI Runtime for the service account that is used by the build servers
  2. Step 2: Run dotnet restore and dotnet publish
    Download and modify the powershell script found at http://pastebin.com/yyjbGDW9. It assumes that each folder is an individual .net core project that needs to be published. Modify accordingly to your environment

    It is important to add in the OutputDir argument as that defines where the published project goes

    As this builds all the projects, you may also want to check “Continue on error”

  3. Step 3: Deploy to the servers
    You can find the script I use at http://pastebin.com/8jBHz3Zf. Important thing to note is that you need to first stop IIS on the target server before copying the files over as running net core on IIS locks the dll files
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: