dotnet / project-system

The .NET Project System for Visual Studio
MIT License
969 stars 387 forks source link

Show contentFiles from nuget packages in legacy project system #3431

Open nkolev92 opened 6 years ago

nkolev92 commented 6 years ago

In the new project system, the static contentFiles from Nuget packages are linked and shown in the solution explorer.

oldvsnewcsproj

The old project system should do the same.

Note that CommandStuff.cs is the only element from the package above the needs shown. It's also marked as a link.

The example illustrates the difference in 15.7 P3. ClassLibrary1 is legacy, ClassLibrary39 is SDK csproj.

Additionally it's important that these files are read-only. Related issue to make them read-only in new project system - https://github.com/dotnet/project-system/issues/2141

As more and more people are moving their projects as part of the effort in https://github.com/NuGet/Home/issues/5877, this becomes more and more important.

//cc @rrelyea @anangaur @davkean

anangaur commented 6 years ago

Why does globalpackagesfolder show up here? My understanding was the contents of the contentfiles folder show up in the solution explorer.

nkolev92 commented 6 years ago

@anangaur That's just my test setup :) When I test things with packages I build locally, I set the global packages folder to a directory inside the project, to avoid polluting my actual global packages folder.

And new project system just imports/shows everything under the project folder.

anangaur commented 6 years ago

I guessed so but this makes the screenshot confusing. Can you clarify the following in the description?

bording commented 6 years ago

One thing missing from how the new project system handles contentFiles is that it doesn't make them read-only, so if you edit them, you're editing the file from the NuGet package cache folder.

When adding contentFiles support to the old project system, would it be possible to make them read-only from the initial implementation?

nkolev92 commented 6 years ago

@bording Great point, there's already a task for that. I've linked it in the original issue.

bording commented 5 years ago

@nkolev92 @anangaur Is there any chance of this being addressed in the VS 2019 timeframe?

tmeschter commented 5 years ago

Tom's triage notes: I recommend we close this.