When using "nuget pack MyProject.csproj -Properties Configuration=Release", the release dll is picked up successfully. However, when using "nuget pack MyProject.csproj -Build -Properties Configuration=Release", then the dll gets built and packed in its default configuration (which, in that case, is Debug).
I made a reproduction for that bug in a zip file - you would just have to run the NugetPackBuildRelease.bat file in order to reproduce the bug. I believe that the underlying issue is the one in the title of that ticket - that none of the properties specified in nuget pack are passed to MSBuild.
This bug is annoying because it means that the "-Build" switch is ultimately suited only to the simplest build processes, which do not use any properties - any more evolved use case would require direct use of MSBuild.
Comments: We actually ran into this bug quite recently with the NuGet.Server package that we produce. We do pass the property to MsBuild, but I think the way we assign it isn't correct.
I made a reproduction for that bug in a zip file - you would just have to run the NugetPackBuildRelease.bat file in order to reproduce the bug. I believe that the underlying issue is the one in the title of that ticket - that none of the properties specified in nuget pack are passed to MSBuild.
This bug is annoying because it means that the "-Build" switch is ultimately suited only to the simplest build processes, which do not use any properties - any more evolved use case would require direct use of MSBuild.
Comments: We actually ran into this bug quite recently with the NuGet.Server package that we produce. We do pass the property to MsBuild, but I think the way we assign it isn't correct.