I did this by splitting up my Job into 4 tasks:
- Source Code Checkout
As you would expect. It's the default task within a job anyway.
- Download NuGet.exe
A one-liner Powershell inline script with
Invoke-WebRequest -Uri 'http://nuget.org/nuget.exe' -OutFile '.\nuget.exe'
- Download all package dependencies via NuGet
This approach now seems to be the "new" recommended approach, so it's a simple CMD file that executes
nuget.exe restore
- MSBuild
Using the .SLN file as parameter for the Project File option in the task and passing any needed other msbuild options in the Options field
My Bamboo server is on Linux and my remote agent is on the Windows build machine.
In your case you would follow up with the 5. task, e.g. the Nunit tests - though you may decided to put that into a separate stage, and split the tests into jobs that can run in parallel.
Edit: almost forgot: I also have a Nuget.config file
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageRestore>
<!-- Allow NuGet to download missing packages -->
<add key="enabled" value="True" />
<!-- Automatically check for missing packages during build in Visual Studio -->
<add key="automatic" value="True" />
</packageRestore>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
<add key="Syncfusion" value="http://nuget.syncfusion.com/xamarin/" />
</packageSources>
<!-- Used to specify which one of the sources are active -->
<activePackageSource>
<!-- this tells only one given source is active -->
<add key="NuGet official package source" value="https://nuget.org/api/v2/" />
<!-- this tells that all of them are active -->
<add key="All" value="(Aggregate source)" />
</activePackageSource>
</configuration>