You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Example "Pack the project using a .nuspec file" has issues #13281
First, this example uses /p: instead of the -p: used everywhere else, which is misleading. It is valid syntax, but it is not consistent with the rest of the document, nor with the supporting document that it links to.
Second, the link that provides detail on how to pack the project using a .nuspec file says to use the following syntax for NuspecProperties: -p:NuspecProperties=\"key1=value1;key2=value2\"
But the escape characters are not needed. In fact, if you use the escape character in an Azure DevOps pipeline it will not pass the properties to the .nuspec file and the task will fail.
Example that fails from an Azure DevOps .NET core task: -p:NuspecProperties=\"version=$(build.buildNumber)\"
The following works correctly in Azure DevOps and when running from the command line (Win 10): -p:NuspecProperties="version=$(build.buildNumber)"
Please add a valid example of NuspecProperties to the example on this page. It seems like this property would be used as much as NuspecBasePath.
Thank you!
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
ID: a7e805a3-f2ec-b05a-d5c8-29f7a8c16a5f
Version Independent ID: 4257ec12-df6f-ec52-aad3-012e5fce8133
I don't think the escaping is necessary in the example.
Beyond that it's msbuild's parsing that can be tricky. Not sure how to clarify the multi property passing further. Issues like htmlencoded chars affect all msbuild props.
actually, my apologize.. I just realized this issue was related to the content of dotnet-pack command page.. my consideration was to msbuild-targets #packing using a nuspec the referenced link in these comments.
Activity
mairaw commentedon Aug 9, 2019
Thanks for your feedback @tpeiffer. @karann-msft @rohit21agrawal can you help with this request? Is the command we have for dotnet pack invalid here?
Also, can you check that the article referenced here (https://docs.microsoft.com/nuget/reference/msbuild-targets#packing-using-a-nuspec) is correct when it comes to NuspecProperties?
I'm taking care of the first issue, to make the option consistent by using -p.
mairaw commentedon Feb 21, 2020
Friendly ping @karann-msft @rohit21agrawal
brcaswell commentedon Mar 1, 2020
2 remaining items
nkolev92 commentedon Mar 2, 2020
I don't think the escaping is necessary in the example.
Beyond that it's msbuild's parsing that can be tricky. Not sure how to clarify the multi property passing further. Issues like htmlencoded chars affect all msbuild props.
brcaswell commentedon Mar 2, 2020
brcaswell commentedon Mar 2, 2020
actually, my apologize.. I just realized this issue was related to the content of dotnet-pack command page.. my consideration was to msbuild-targets #packing using a nuspec the referenced link in these comments.
sorry for the confusion.
brcaswell commentedon Mar 2, 2020
in the following snippet on the page:
does
-p:NuspecProperties="id=$(PackageId)"work?if unspecified (like the example does currently), does it use
NuspecPropertiesin the csproj file?I think these are the considerations being raised in this issue, on this page.
sfoslund commentedon Apr 24, 2020
@tdykstra it sounds like this issue should be transfered to msbuild-targets article, per this comment.
As for this question, I don't know. @nkolev92 do you?
nkolev92 commentedon Apr 24, 2020
@brcaswell Yeah, that's an msbuild thing.
Things passed on the cmd when invoking msbuild are considered global properties and override the project values. https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild-properties?view=vs-2019#global-properties
Don't escape quotation marks in NuspecProperties example
Don't escape quotation marks in NuspecProperties example (#2012)