-
Notifications
You must be signed in to change notification settings - Fork 28
Do not include "contentFiles/" prefix in <contentFiles/> (issue #6556) #164
Conversation
Was also already reported here: NuGet/Home#6556 |
See NuGet/Home#6556 (comment). I don't think this PR is correct. |
Can someone approve these changes? We really need this. |
Read my comment above and on the linked issue plz. Thanks |
Read the answers to your comment please. |
I have created a TestProject example. If I put my content dependency this way:
Everything in the package goes ok, but nuspec file get contentFiles in the directory specification:
The problem is the nuget restore will not be able to detect the file and will assume default configuration for the dependency (compile, not copy to output), making it impossible to have this type of content in the nuget. Content from project.assets.json:
Now if I directly change nuget package, namely the nuspec setting include to "any\any\mybinarydependency.bin", while maintaining the directory structure "contentFiles\any\any\mybinarydependency.bin" within the package, nuget restore will detect the file and it will assume the correct properties that have been configurated in the .csproj. buildAction to content and copyToOutput to true.:
|
Thank you so much! |
Nuget expects the include paths relative to the package contentFiles folder (see official examples https://docs.microsoft.com/en-us/nuget/reference/nuspec#including-content-files). Otherwise the BuildAction, CopyToOutput and Flatten attributes have no effect. This PR fixes that by adjusting the included path accordingly.