-
Notifications
You must be signed in to change notification settings - Fork 255
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 is being ignored by non core projects #7672
Comments
hey @TrabacchinLuigi, ContentFiles only works for PackageReference projects (it doesn't work in packages.config), are you installing the package with PackageReference in the net472 project? You can read more about it here: https://blog.nuget.org/20160126/nuget-contentFiles-demystified.html |
Yes I know, we moved from packages.config to packageReferences few days ago, and noticed our packet was not adding the needed files anymore, so I decided to read about and discovered that the the new way of doing was this cool new node contentFiles... I tried also to keep the old content folder, and then dropped it because I saw no differences, and I read it was only for backward compatibility... Since I wasn't able to make it work, just for testing I've installed the same updated package in other projects the only one that worked was .net core projects |
this is how the package looks like:
and this is how it's referenced:
|
I've tried also on .net4.6.1 projects, still doesn't work |
I've tried also to create a package with some source code placed into contentFiles\cs\any\$id$, the weirdness increment: the files does not show up in the solution, the IDE let you use the types defined in the invisible linked files, but if you use them it won't let you compile anymore, if you don't use them it will compile them successfully, and you can find them in the produced assembly with a decompiler. |
@TrabacchinLuigi what you means content files are being ignored in net472 project? how are you validating it? Have you build your project and checked into These content files wont be visible in solution explorer or anything, but they should be available to be consumed by the project and when you build, they should be copied into output folder since you set |
As i said those are tools that make building possible, won't have much sense to have them available after building, but since this is not the only issue i'll provide some examples (not now, it's 2AM here). Another super disappointing detail about the new PackageReference method is that you can't embed those references but this is another topic... |
The issue about the content files being displayed is not NuGet's to solve. You can track is at our partner team's repo. dotnet/project-system#3431 Any repros you can provide? |
sorry i have no time to make a repro, but i've understood that putting "build pipeline" into nuget packages isn't a good idea, and that mostly it was a visualization problem, i'll track the other issue and close this one |
I've created a very simple package that is supposed to contain some tooling for the build it just contains an .exe and a .dll into contentFiles\any\any\tools
It works fine when installed in .net core projects, but it doesn't when installed in .net472 projects.
I've done some testings and installing it in projects with packages.config instead of packageReferences doesn't seem to make any difference.
Also changing ..\any\any.. to ..\cs\net472.. or a combination of any, cs and net472 doesn't seem to solve the problem.
I've installed the package via visual studio 2017 GUI. I can't determine the version of the embedded nugget client, but Vs is fully updated.
I also have the last nuget.exe but I still have to try to install using it... I just made the packet with it.
The text was updated successfully, but these errors were encountered: