Skip to content
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

Show content files from nuget packages as a distinct group in solution explorer #603

Closed
srivatsn opened this issue Oct 13, 2016 · 15 comments · Fixed by #6155
Closed

Show content files from nuget packages as a distinct group in solution explorer #603

srivatsn opened this issue Oct 13, 2016 · 15 comments · Fixed by #6155
Assignees
Labels
Feature-Dependency-Node "Dependencies" node in Solution Explorer that display project, binary & package references Triage-Approved Reviewed and prioritized
Milestone

Comments

@srivatsn
Copy link
Contributor

Content files from packages are either source files passed to the compiler or other files treated as content.

In either case it would be good to show them in the solution explorer. One way to represent them might be similar to a readonly linked file (maybe a different icon to distinguish) along with the rest of the files.

It may also be nice to show them under the package node itself but maybe unnecessary and maynot even be obvious.

@davkean
Copy link
Member

davkean commented Oct 13, 2016

Before showing them in Solution Explorer, other than under packages, I already discussed with NuGet that we should move the adding of these files so that we can pick them up during evaluation time and not requiring design-time builds. One way we could do this is by generating static <Content/> at the same time that we generate the props/target imports instead of dynamically creating them.

@davkean
Copy link
Member

davkean commented Oct 13, 2016

Everything shown in the source tree today other than dependencies are evaluation time.

@srivatsn
Copy link
Contributor Author

srivatsn commented Oct 13, 2016

Synced with @yishaigalatzer - NuGet will work on doing static generation of the content includes so that we can pick them up during evaluation time. (Otherwise the UX would be bad since the tree will jump around based on design time builds for different projects completing at different times).

We'll need to mark these files as readonly for now and real editing and overriding will be enabled with #604. One approach to that could be that while generating the items for the files, NuGet can add some metadata to them that tells us that we need to make them readonly.

@srivatsn
Copy link
Contributor Author

srivatsn commented Feb 13, 2017

Currently because NuGet includes the content files statically in the generated props file, they show up in the tree as being included from the NuGet folder and this is confusing.. See #1506. We should give a different visual treatment for these or group them differently under a virtual node.

@tannergooding
Copy link
Member

I was going to look at taking this on since it seems fairly straightforward.

Today, you will get something like the following:
image

However, it sounds like we want to modify this so we have an explicit 'Content Files' node:

  • ClassLibrary3
    • Dependencies
      • NuGet
        • Microsoft.VisualStudio.Setup.Configuration.Native.AnyCPU (1.3.269-rc)
      • SDK
    • Content Files
      • x64
        • Microsoft.VisualStudio.Setup.Configuration.Native.dll
      • x86
        • Microsoft.VisualStudio.Setup.Configuration.Native.dll
    • Class1.cs

or possibly:

  • ClassLibrary3
    • Dependencies
      • NuGet
        • Microsoft.VisualStudio.Setup.Configuration.Native.AnyCPU (1.3.269-rc)
          • Content Files
            • x64
              • Microsoft.VisualStudio.Setup.Configuration.Native.dll
            • x86
              • Microsoft.VisualStudio.Setup.Configuration.Native.dll
      • SDK
    • Class1.cs

Is that correct?

@abpiskunov
Copy link
Contributor

  1. Hold on , i am working on a change that would redesign Dependencies tree and you work will be lost. 2. in your sample you are showing "dlls" which we already show under package anyway - would it be duplicated ?

Also it is not straight forward anyway - all packages with their dependencies are received form a designtime build events (not evaluation which gets only top level packages), you would have to change designtime targets and tasks that generate nuget package hierarchy and follow rules that we have for packing data there.

Also - is it really ok to show content files under Dependencies node ? We show there "dependencies" binary of client "packages" , not a content files ...

@tannergooding
Copy link
Member

in your sample you are showing "dlls" which we already show under package anyway - would it be duplicated ?

In this case, these DLLs are native (not managed) and must be included as 'ContentFiles' to get the build to copy them to the output directory.

Also - is it really ok to show content files under Dependencies node ? We show there "dependencies" binary of client "packages" , not a content files ...

As @srivatsn indicated: "We should give a different visual treatment for these or group them differently under a virtual node."

This is why I gave two examples and attempted to confirm the intended design here.

@abpiskunov
Copy link
Contributor

Sounds good. I personally like the second sample since it shows what is brought by each package, which could be a pattern for the future and other dependency providers could follow it. However let's wait for @srivatsn and @davkean votes. (if we chose second option later we could add a Filter View that would show all content files brought by dependencies which would do same thing as sample 1 essentially) Implementation wise those sample would be pretty different though.

@bording
Copy link
Contributor

bording commented Mar 15, 2017

What about source files that are brought in via ContentFiles? It would be weird to find those inside the Dependencies tree, since they are actually compiled as part of the project.

@srivatsn srivatsn modified the milestones: 16.0, 15.3 Mar 29, 2017
@adamralph
Copy link

Content files are currently shown in the solution explorer. Does this issue need re-titling?

@srivatsn srivatsn changed the title Show content files from nuget packages in solution explorer Show content files from nuget packages as a distinct group in solution explorer May 4, 2017
@srivatsn
Copy link
Contributor Author

srivatsn commented May 4, 2017

Changed the title to track showing them in some distinct groups

@nkolev92
Copy link
Contributor

@davkean
Can this considered to be the tracking item for display contentFiles in legacy csproj?
Or is there a better one for that?
I was unable to find one.

@davkean
Copy link
Member

davkean commented Mar 29, 2018

Nope please file a new bug for that.

@davkean davkean modified the milestones: 16.0, Unknown May 28, 2018
@jjmew jjmew added the Triage-Approved Reviewed and prioritized label Jan 14, 2019
@drewnoakes drewnoakes added the Feature-Dependency-Node "Dependencies" node in Solution Explorer that display project, binary & package references label Apr 5, 2020
@drewnoakes drewnoakes self-assigned this Apr 5, 2020
@drewnoakes drewnoakes modified the milestones: Backlog, 16.7 Apr 5, 2020
@drewnoakes
Copy link
Member

This has been fixed in the dependencies-tree-performance branch which will merge for 16.7.

@bording
Copy link
Contributor

bording commented Apr 7, 2020

@drewnoakes Looking at the images in #6066, it's not yet clear to me what this experience looks like fully.

For example, do those content files still show up in the project as the currently do in addition to the new location in the package's node?

EDIT: Ok, I see that the data.txt is still displaying. I overlooked that originally. Glad to see that is unchanged.

In that case, any chance of #2141 being prioritized?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature-Dependency-Node "Dependencies" node in Solution Explorer that display project, binary & package references Triage-Approved Reviewed and prioritized
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants