In this post I will show you how to build a ASP.NET 5 1.0.0-rc1-update1 project with Visual Studio Team Services.
First make sure you have the latest version from https://get.asp.net. Download and run the installer. Once the installation is complete run the following command to get the latest version of the runtime.
dnvm upgrade
Now using Visual Studio 2015 Update 2 create a new ASP.NET 5 Web Application.
Commit your changes into Visual Studio Team Service. With all your code in source control, we can now create our build definition.
- Log in to Visual Studio Team Service
- Click the Build hub
- Click the green plus
- Select the Visual Studio template
- Click Next
- Select your repository
- Check the box for Continuous integration
- Click Create
With the build created, we need to add the required tasks.
- Click Add build step…
- Select the Utility category
- Click Add next to the PowerShell task
- Click Close
- Drag and drop the PowerShell task to the top
- Select the PowerShell task
- Change the Type to Inline Script
- Enter the following code for Inline Script (double click code to copy)
&{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}
$gJson = gc -Path .\global.json -Raw -ErrorAction Ignore | ConvertFrom-Json -ErrorAction Ignore
$dnxVersion = $gJson.sdk.version
& $env:USERPROFILE\.dnx\bin\dnvm install $dnxVersion -Persistent
dir -Path .\ -Filter project.json -Recurse | ForEach-Object { & dnu restore $_.FullName 2>1 }
- Click Save
- Give your build a name
- Click OK
- Click Queue build…
- Click OK