project-system icon indicating copy to clipboard operation
project-system copied to clipboard

Show contentFiles from nuget packages in legacy project system

Open nkolev92 opened this issue 7 years ago • 7 comments

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

nkolev92 avatar Mar 29 '18 23:03 nkolev92

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

anangaur avatar Mar 29 '18 23:03 anangaur

@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.

nkolev92 avatar Mar 29 '18 23:03 nkolev92

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

  • the content file in this case
  • the layout of the this file in the package.

anangaur avatar Mar 29 '18 23:03 anangaur

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?

bording avatar Apr 06 '18 21:04 bording

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

nkolev92 avatar Apr 06 '18 21:04 nkolev92

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

bording avatar Nov 14 '18 20:11 bording

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

tmeschter avatar May 31 '19 20:05 tmeschter