-
Notifications
You must be signed in to change notification settings - Fork 392
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 pollute the root of the project #6290
Comments
Showing the files in the tree is by design. However they shouldn't be editable. We have bumped the priority of #2141 |
Wow this is just getting closed because its by design???? @jjmew I believe just putting these files in the root of the project is very confusing. Theres no way to change this. Even with some csproj hacking the best you can do is having some empty folders. Iam not the only one bothered by this NuGet/Home#4856. If this is the design then its a pretty bad one. |
Please remember to keep comments respectful, we're humans over here. Showing files from imports is very much by design, it's fundamental to SDK-based projects. Without it, you would have zero files listed in a project by default as the default set of globs come from imports. Package authors should be using As for the folders still being visible, this is owned by an external team to this respository and was being tracked by https://developercommunity.visualstudio.com/content/problem/495189/parent-folder-of-items-marked-as-visiblefalse-stil.html. It was closed as lower priority but I've converted it to a product Suggestion, and reopened it so you can vote it on. It might take a while to reflect on the Developer Community side. |
Just closing this immediately because 'this is by design' without any explanation was not really respectful either. Multiple ppl made issues about this and asked related questions about this on stackoverflow. Iam sorry if you found my surprised comment disrespectful.
But just putting them in the root of a project is very confusing. Its not clear why and where these files come from for the user and trying to delete them results in a error. It should be made more clear that a package and what package is adding these files (in addition to properly making them readonly but thats a different issue).
I added
👍 |
Thanks! 👍
Sorry if I'm asking dumb questions 😄 But can you clarify where we'd add a If there is an intended way how to handle scenarios like this, that would be a good start for us. |
xUnit does this, here's an example: xunit/visualstudio.xunit@d54a5e4 I can't find the original source of above, but you can explicitly include the items via a targets file and specify visibility. There's no built-in way to do this via the contentFiles feature. |
@davkean This doesn't solve anything for people using such package if the author did not put it as not visible, especially for old nuget packages. And it shouldn't even be a responsibility of the package/library maker. Some users of those packages might decide they want to display, some might not. So there should be an option to show/hide this on a per-project basis. Look at #3302 for an idea of the mess it can be. I have to scroll down more than 60 items before seeing the first class of my project. So here is a proposal: <PackageReference Include="ThirdParty" Version="1.0">
<ContentFilter Include="*.config" Visible="False" />
<ContentFilter Include="*.dll" Visible="False" />
</PackageReference> |
This issue has been closed in lieu of NuGet/Home#4856. Use it for any proposal you have. |
@davkean What about:
? Let's go:
And many topics here: this one, #4602, #5859 ... You can somehow influence to this external team? |
To follow up, the issue where linked folders continue to show after their items have been marked Visible=false, has been fixed in the latest |
Correction; the fix will be in 16.9 Preview 2 when it releases. |
Yea thank you, I just wanted to write that at 16.8. p6 still doesn't work... |
I tried it on 16.9 Preview 2 and it's working, fantastic, looking forward to it! |
Visual Studio Version: 2019, seems to happen with all versions I have used so far up to 16.6.1
Summary:
![84692048-81974480-af45-11ea-9f32-1565373e3615](https://user-images.githubusercontent.com/19387223/84705268-70f1c900-af5b-11ea-9fb4-40e03565d646.png)
Currently contenfiles seem to just get dumped in the root of the project in the solution explorer:
This is very confusing behavior as its not clear where these files are coming from. In our usecase we use contentfiles to deliver some resource files such as textures in our sample packages for our game engine. We would prefer to not show all these files. I saw you can solve it partially with hacks like these:
But you still end up with empty folders appearing.
Steps to Reproduce:
Add a nuget package with contenfiles to the solution (for instance our AdamsLair.Duality.Samples.Tilemaps 4.0.0-alpha2 package)
See all the contenfiles appear in the solution explorer
Expected Behavior:
Show these files in Dependencies/Packages/Packageid. Alternatively make it possible to hide these files by adding a attribute to the nuspec file and csproj.
Actual Behavior:
All contenfiles are visible in the root of the project in the solution explorer
User Impact:
Very confusing for users, on top of that these files are editable which they shouldn't be and this leads to nasty bugs. This was already reported in #2141 though but is still not fixed.
Contentfiles have been around for a while now but the bugs in the tooling don't seem to get fixed. Whats the holdup? This is not production ready like this. Are there any major blockers to fix this?
The text was updated successfully, but these errors were encountered: