question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Content files do not get copied

See original GitHub issue

Description

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:

image

In the packages folder I can see the package with the Content folder:

image

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:open
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
tonyj444commented, Apr 26, 2021

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 use contentFiles. https://docs.microsoft.com/en-us/nuget/reference/nuspec#including-content-files

I 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 to contentFiles/any/any rather than into content.

Hopefully this saves someone some time in the future 🤷

0reactions
tonyj444commented, Apr 26, 2021

Yep, that’s what I ended up doing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

visual studio - Copy always to output directory does not work
In the file properties in Visual Studio, set: Build action: None. Copy to output directory: Copy always.
Read more >
Never set 'Copy To Output Directory' to 'Copy always'
- "Copy always" means "make sure I always have the most up to date version." - Because the build process may modify the...
Read more >
Folder contents failing to copy
Having recently updated to Windows Pro 8,1, I find that when I copy a folder to a network drive , the contents do...
Read more >
Copy NuGet Content Files to Output Directory on Build
It turns out, to no surprise, that including content files in a NuGet package will not result in them being automatically copied to...
Read more >
Copying only newer files Win10
Copying only newer files Win10. This seems like a simple task, and there used to be a way to do it using a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found