Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content files copied to output are not inherited by other projects #9176

Closed
ChristianHoe opened this issue Feb 13, 2020 · 1 comment
Closed
Labels
Area:ContentFiles PackageReference contentFiles folder Functionality:Pack Resolution:NotABug This issue appears to not be a bug Resolution:Question This issues appears to be a question, not a product defect

Comments

@ChristianHoe
Copy link

Using VS2019 and a solution with lots of csprojs,
I have created a NuGet package which just copies a exe file to /bin.

<contentFiles> <files include="**/helper.exe" buildActions="Content" copyToOutput="true" /> </contentFiles>

The package works fine, but if I reference the project in an other project, the exe file (contentFiles) is not copied.

Referencing the package in the top project is not an option, because it is still using the old package.json.

How do I get the content files copied to inherited projects?

@dominoFire dominoFire added Area:ContentFiles PackageReference contentFiles folder Functionality:Pack labels Feb 15, 2020
@nkolev92
Copy link
Member

Hey @ChristianHoe

In PackageReference projects, the content files are by default not transitive.
Refer to https://docs.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files#controlling-dependency-assets.

To make the contentFiles flow transitively to the parent projects, please change the PrivateAssets metadata of the packing project.

@nkolev92 nkolev92 added Resolution:NotABug This issue appears to not be a bug Resolution:Question This issues appears to be a question, not a product defect labels Jun 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area:ContentFiles PackageReference contentFiles folder Functionality:Pack Resolution:NotABug This issue appears to not be a bug Resolution:Question This issues appears to be a question, not a product defect
Projects
None yet
Development

No branches or pull requests

4 participants