VSTS build agent without Visual Studio

Visual Studio Team Services (VSTS) come with hosted agents that allow you to build .NET applications out of the box.

If you want to run an on-premise agent however, and prefer not to install Visual Studio on it, the setup might not be so straightforward. Maarten Balliauw covered this topic perfectly.

This is what got me up and running, after the default on-premise agent installation:

  1. Install the correct .NET SDK
    1. For example a 4.6.2 app would require the .NET Framework 4.6.2 Developer Pack
    2. This installs the required reference assemblies under Program Files, which are used by the build to compile your application
    3. Don’t confuse this with the .NET framework, which is just the runtime to execute a compiled .NET app
  2. MSBuild tools to use msbuild
    1. For Visual Studio 2015 and previous versions, get the Microsoft Build Tools, so for VS2015 install Microsoft Build Tools 2015
    2. For 2017 they changed up the name to Build Tools for Visual Studio 2017 (scroll down and look under Other Tools and Frameworks)
      1. In response to Maarten’s post, Phil Haacked opened a uservoice which resulted in this which attempts to improve things, nice!
  3. MSTest if you use it
    1. The Agents for Microsoft Visual Studio 2015 installs mstest.exe, the description focuses on distributing automated tests to remote machines, don’t worry, it is what you need

So MSBuild uses targets to do its job, which usually come with installations of other software. I got away without installing extra tools, by using these nugets in my project instead:

  1. MSBuild targets for WebApplications
  2. TypeScript MSBuild nuget
    1. Instead of installing the TypeScript tools on the server, this nuget provides everything you need

Then after installing node, I run Grunt from the local node_modules directory of my application, instead of depending on grunt-cli to be installed globally.

Good luck!

Theme music for this blog post

Advertisements
VSTS build agent without Visual Studio

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