Thursday, February 13, 2014

NuGet.TfsBuild v1.1 Released

Late last night I released NuGet.TfsBuild v1.1 to nuget.org.

This is a minor update - but brings an extra feature into the tooling - the ability to configure the HTTP Proxy that NuGet uses when restoring packages.

If you've not heard of NuGet.TfsBuild before, it's a little NuGet package that helps you use a private, password-protected NuGet repository for you internal dependencies and specifically when using cloud TFS build services. 

You can read all about it's creation and use here.

We've now been using it on our on-premise build servers so that we don't have to manually configure our private NuGet package source on each server manually - but there was a problem.

Our build servers are on-premise, and are protected behind firewalls, so need NuGet configured to use a specific HTTP Proxy. The good news is that NuGet.exe already supports this, so it was just a small change to the MSBuild targets file to add this into NuGet.TfsBuild.

You enable and configure this feature by using the following extra MSBuild switch:
/p:NuGetHttpProxy=http://{myProxy}:{myProxyPort}
If your proxy requires a specific user, then add
/p:NuGetHttpProxyUser={myProxyUser}
Simple.

For bonus points, I also fixed that irritating warning that the tooling would generate when it tried to remove the package source before re-adding it - so your builds will now be cleaner.

Enjoy!


No comments: