MSBuild properties in *.nuspec files when using OctoPack

I’ve discovered I can’t use MS Build properties (like ‘Configuration’, ‘RequestedBy’ and ‘ChangesetNumber’) inside the *.nuspec file.
When using the regular nuget.exe this is working perfectly fine.

Hi,

Thanks for posting! The difference is that you use NuGet.exe pack on a *.csproj or *.sln file, while create a custom .nuspec and call NuGet.exe pack on that. The properties that you mention are normally only available when building from a solution/C# project.

The workaround is to pass this when you call OctoPack:

"/p:OctoPackNuGetProperties=Configuration=Release;Foo=Bar"

These properties are then passed to NuGet.exe via the -Properties argument:

Hope that helps!

Paul

Would be very nice if Octopack could get at the MSBuild variables without having to explicitly pass build arguments.