Build ASP.NET Core RC2 on Hosted Agents

If you have been following my post on ASP.NET Core RC2 many began by creating a private build agent.  The reason being the Hosted agents did not have the .NET Core RC2 SDK installed.  But that recently changed.

The nice thing about Hosted build agents is they allow you to start building your projects immediately with no installation.  However, it is a challenge to make sure the agents have tools on them the instant that they are released.  There is a lot of testing required to make sure the tools play nice with all the other tools already installed on the Hosted agents. Because we will never be able to install every toolset on our Hosted agents we allow customers to also install their own agents.  Those agents can be anywhere, on-premises or in the cloud.  Those agents can also be installed on Windows, Linux, and Mac,  When you install your own agent you are free to install any tools you please.  The way you identify what tools are installed is by registering them as capabilities.


When you create a build or release definition that requires a particular capability you are able to register that requirement as a Demand.

Build Release
image image

On the agents we created in the previous blog posts we registered the ASP.NET_Core capability to identify the agents that were running .NET Core RC2.  The Hosted agents however, did not elect to register the capability separately.  Therefore, to run the builds we created in the previous posts against the Hosted agents simply remove the ASP.NET_Core demand and change your queue to Hosted.

I recently did this to all my ASP.NET Core RC2 builds and each one succeeded against the Hosted agents.

Comments (3) -

  • How do I swap out my connection string when I release to Azure? I'm currently using this: -connectionString @{"$(ConnectionStringName)"="Server=tcp: $(ServerName).datab..."} as an additional argument but will this work as connection strings are in appsettings.json not web.config?
    • That is a really good questions. I will have to do some research with the Azure team.  One alternative is to use tokenization and have a task change the values for you.  There is a task in that will do that for you.

Add comment