Using NuGet.targets to create Nuget packages

c#, nuget

Solution

You can do that. Alternatively you can use nuget.exe pack command in the post build event ( more details @ http://docs.nuget.org/docs/reference/command-line-reference#Pack_Command ) or use true in the csproj file.

Problem

I have a C# project that uses Nuget for package management. I enabled package restore so it created the `.nuget` folder. Then I want to create a Nuget package of this project. Can I create nuget `.nuspec` files in the `.nuget` folder and modify the `Nuget.targets` file to allow the creation of the package and upload to the galery when I'm in release mode? Thanks.

Original source