Content files do not get copied
See original GitHub issueDescription
Paket version 5.194.3
I have a NuGet package with a Content
folder which contains 1 file. Whatever I try, it is impossible to get this Content file to show up in my project.
Repro steps
Clone https://github.com/Informatievlaanderen/example-registry.git at commit https://github.com/Informatievlaanderen/example-registry/commit/04fb3fe67341aa679d5aed24db4192fd5fcb20e8
https://github.com/Informatievlaanderen/example-registry/blob/04fb3fe67341aa679d5aed24db4192fd5fcb20e8/paket.dependencies#L33 lists nuget Be.Vlaanderen.Basisregisters.Testing.Infrastructure.Events ~> 1.0 content: true, copy_content_to_output_dir: always, copy_local: true
(Yes, I tried it all eventually :p)
https://github.com/Informatievlaanderen/example-registry/blob/04fb3fe67341aa679d5aed24db4192fd5fcb20e8/test/ExampleRegistry.Tests/paket.references#L8 references this package
When I run paket install --force
nothing gets added to the project:
In the packages
folder I can see the package with the Content folder:
Expected behavior
I expect the InfrastructureEventsTest.cs
folder to be copied to the folder. Just need the file to be copied, MSBuild (.NET Core) should probably take care of the rest.
Actual behavior
Nothing happens
Known workarounds
No idea.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Adding this in case it’s of use to anyone else that runs into this issue:
The nuspec docs state that
content
elements won’t be picked up in the new-style projects. Instead you should usecontentFiles
. https://docs.microsoft.com/en-us/nuget/reference/nuspec#including-content-filesI won’t pretend to have the time/patience to understand why this has been changed, but for me the solution was to update
paket.template
(of the package being consumed) to copy the output files tocontentFiles/any/any
rather than intocontent
.Hopefully this saves someone some time in the future 🤷
Yep, that’s what I ended up doing.