dotNetChris @ Marisic.Net

December 14, 2011

Nuget 1.6 is released along with breaking changes

Filed under: Nuget — Tags: , , — dotnetchris @ 4:56 pm

First for some back ground. I’ve found the development story of creating nuget packages to be a bit rough. This is the development story I’ve come up with. In the root of my solutions that will build nuget packages I place Nuget.exe the command line executable. (I commit this to hg and keep it in solution)

Following that any project that needs to build itself as a package, I create a nugget.cmd in the project root. This is an example of what my nugget.cmd would look like:

_ SOLUTION_\Nuget.exe pack _ PROJECT_\myProj.csproj -Configuration Release -Verbose -OutputDirectory .\bin\

This works very well as I can right click the project from the solution explorer and Open Command Prompt then just run nugget.cmd. I believe Open Command Prompt  comes from the PowerCommands for VS VSIX extension.

Enter today, I updated the Nuget.exe to 1.6 using “Nuget.exe update” went to run my nugget.cmd and was presented with:

Unknown option: ‘-Configuration’

The migration path to this is to update your build scripts to behave as:

Nuget.exe pack _ PROJECT_\myProj.csproj  -Build -Verbose -OutputDirectory .\bin\ -Properties Configuration=Release

Another breaking change that I encountered is if you use the replacement tokens with nuget such that your nuspec file contains

<id>$id$</id>
<version>$version$</version>
<authors>$author$</authors>
<owners>$author$</owners>

The $version$ property will no longer properly read your AssemblyInfo version attribute. After upgrading to 1.6 and building my project it would just result in 1.0 instead of the correct version. I had to set the specific version in the nuspec file to overcome this. I opened issue #1777 on Codeplex for nuget about this as this seems like a bug.

BloggingContext.ApplicationInstance.CompleteRequest();

The Shocking Blue Green Theme. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 242 other followers

%d bloggers like this: