Packing NuGet projects compiled in release mode?
If you are using a post-build event and you want to create a package whether using Debug or Release configuration you can setup the post-build event commandline like so:
"<path to nuget tools>\NuGet.exe" pack "$(ProjectPath)" -Prop Configuration=$(ConfigurationName)
You can solve it like this:
NuGet.exe pack Foo.csproj -Prop Configuration=Release
(reference)