Sunday, 20 November 2016

Start building ASP.NET Core 1.1 with TFS

In my spare time I am looking at ASP.NET Core – it brings so much change that you can’t really ignore it even if you are not a web developer.

After putting together the first samples (thanks to the help of a book as well, review coming in a few weeks) I wanted to build something in my lab with a TFS build, so totally on-premise and with no connection to the shiny VSTS.

After installing all the prerequisites (Visual Studio 2017 RC is a great starting point, and I added this on top as well) you can easily get up and running by using command-line tools in the build:

0

But it isn’t really what I wanted… and in Team Foundation Server 2017 there are no OOB tools for .NET Core. Not everything is lost though.

Firstly, install tfx-cli. Not only it works perfectly on-premise as well as with VSTS, but given that TFS now has a Personal Access Token system we can stop using basic authentication with it. Awesome.

image

Then, we need the nice task VSTS uses. You can get it from here and upload it to your local TFS by using tfx build tasks upload --task-path <your path>. Simple as that.

So you can start using it! Instead of using a .json file as a Project file you can totally point it at a .csproj file – what the task does is nothing but wrapping calls to dotnet.exe so as long as it is updated you are totally fine.

image

As I am using a basically empty ASP.NET Core application I unchecked the Publish Web Project option in the dotnet publish step – I want total control over the command. Zip Published Projects is fine as it just zips the artifacts.

image

This is it – I now have a CI build running in…say five minutes? Smile

5 comments:

  1. the blog is about Deploying a SQL Server Data Tools Database #dot net it is useful for students and Java Developers for more updates on dot net follow the

    link dot net online training

    ReplyDelete
  2. I believe there are many more pleasurable opportunities ahead for
    individuals that looked at your site.
    visual basic web development company

    ReplyDelete
  3. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not
    encountered such a step like this.

    ReplyDelete
  4. Extremely elegantly composed. I would love to share it on my network.

    ReplyDelete
  5. Nice blog, keep more updates about this type of information. Visit for the best Website Designing and Development Company in Delhi.
    SEO Service in Delhi

    ReplyDelete