Pipeline for .NET Core

The key things to remember when building an automated pipeline for .NET Core are:

  • Never include the project lock file. If you’re using preview3 or later of the tooling, this doesn’t really pose a problem because the lock information is stored in one of the normally-excluded directories like obj/.
  • Make sure that the automated build always does a restore prior to a build.
  • Ensure that after you build, you do a dotnet publish -o publish to publish the service/application that is being managed by the build pipeline. This gathers up all of the application dependencies and bundles them into a single directory ready for push.
  • Make sure that the publish directory contains both a global.json file and a manifest.yml file. The global.json file tells the .NET Core buildpack which versio of the SDK to use in order to compile during cf push