-
Notifications
You must be signed in to change notification settings - Fork 258
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
contentFiles feature is broken #6695
Comments
@evil-shrike the content from contentFiles folder is not meant to be copied to the project directory, instead, at build time it is copied to the output directory (usually |
Source:
files inside nupkg: Destination:
Now build it via |
Content files are apparently not supported in package ref #6659 EDIT: @jainaashish - I dont want to add another comment and muddy up the chain, so I'm editing this one. You are probably correct, and I can unintentionally be quite thick at times, but expecting someone to discern a clear intent and difference between "content files" and "contentfiles" that isnt a typo may be a bit unreasonable. In the linked thread, I've been trying to elicit that difference, and more importantly the value I'd be getting with what I think is intended to be the replacement, perhaps you can explain over there (or email, w/e). |
But where are they supported? For package.config only? |
@StingyJack Please read carefully before commenting, otherwise people will be confused. Content files are supported with PackageReference via This is clearly mentioned on NuGet docs and multiple issues. If you still find it confusing, please let us know and we'll try to make it more understandable. |
@evil-shrike can you attach the nupkg which isn’t working for you? |
@evil-shrike I just tried this on my machine, and the Reports folder is copied to my bin directory.
Does a restore happen between After you run the restore, could you zip the obj folder and attach it so we can see where it's going wrong? |
@rohit21agrawal finally got it working. Sorry for the noise. The reason why it wasn't working is caching. I removed the package from .nuget folder in my profile, restore with May I suggest to improve documentation on https://docs.microsoft.com/en-us/nuget/reference/nuspec#using-the-contentfiles-element-for-content-files - it says nothing about how contentFiles is processed and why it's needed.
|
Same issue, the docs maybe out of date. |
Let's take the official sample "ContentFilesExample" from https://github.com/NuGet/Samples/tree/master/ContentFilesExample and build a package with contentFiles.
Then create a new project with
dotnet new console
and add the package viadotnet add package ContentFilesExample --source path/to/ContentFilesExample/authoring
Expected result:
Files from
contentFiles
folder are added into the project.Actual result:
Files in contextFiles are ignored. Just a PackageReference is added and nothing more.
Documentation says that the feature
contentFiles
is for "NuGet 4.0+ with PackageReference". But the consuming sample in https://github.com/NuGet/Samples/tree/master/ContentFilesExample is old csproj format. So it's useless. Also please note that the documentation is terribly unclear.ps:
The text was updated successfully, but these errors were encountered: