Nuget by hand

nuget logoOur project needs to handle messages from other project(s). These messages are copied across source control. This makes a mess of versioning. We offered to make a Nuget and distribute this from our company feed.

Nuget has written documentation about packaging a project. Waiting for the tools we decided to do a dry-run by creating the Nuget by hand.

How to create a Nuget

First step is to create a nuspec file. This can be done by writing (notepad) it or by generating it with nuget spec. We removed the licenseUrl and projectUrl but provided a iconUrl just for the fun of it.

Next is creating the Nuget file. Using nuget pack projectfile.csproj we packaged the assembly. The resulting Nuget file is copied to a fileshare. In the nuget.config generated while activating nuget restore we provide the fileshare as a nuget source.

The project is build using the Nuget from the fileshare.

What’s next

When the tools arrive a “real” Nuget will be created and published to our company feed. Then we update our nuget.config to exclude the fileshare as a nuget source. The buildserver will then use the “real” Nuget. Bob’s you uncle.

References

Creating and Publishing a Package on nuget.org
Nuget package template by eyecatch.no
Nuget Package Explorer on codeplex.com

About erictummers

My work as a recruited developer changes almost every month. I like challenges and sharing the solutions with others. On my blog I’ll mostly post about my work, but expect an occasional home project, productivity tip and tooling review.
This entry was posted in Development and tagged . Bookmark the permalink.

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