NOTE: This functionality will be baked into a future release of NuGet command line (it's already in the codebase) and therefore I suggest you do not use this project!
NuGet.Versioner makes it a snap to automatically produce versioned NuGet packages by extracting version information from your .dll or .exe during Visual Studio Post-build events.
2 Minute Usage Tutorial
Using the NuGet Package Manager Console, Install NuGet.CommandLine in your project.
PM> Install-Package NuGet.CommandLine
Using the NuGet Package Manager Console, Install NuGet.Versioner in your project.
PM> Install-Package NuGet.Versioner
Add a .nuspec manifest file to your project root and set its "Copy to Output Directory" property to "Copy Always"NOTE: NuGet.Versioner currently extracts version information from the first .dll or .exe listed in the <files> section of the .nuspec manifest. Also, be sure to leave the <version> element empty when entering information in the manifest file. NuGet.Versioner inspects this element when updating the version and will not overwrite an existing value.
Update your project's Post-build event definition to below, where package.nuspec is the name of the .nuspec file you added to your project.
if $(ConfigurationName) == Release (
NuGet.exe pack package.nuspec
Anytime you want to create an updated NuGet package, change your build configuration to "Release" and rebuild - the versioned package will be in your bin\Releases folder!
- Remove the need to specify $(TargetDir) when invoking NuGet.Versioner.exe from Post-build event.
- Transition NuGet.Versioner to NuGet.exe command-line plug-in?