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

Dependencies node should respect DisableTransitiveProjectReferences #5972

Closed
drewnoakes opened this issue Mar 12, 2020 · 10 comments
Closed

Dependencies node should respect DisableTransitiveProjectReferences #5972

drewnoakes opened this issue Mar 12, 2020 · 10 comments
Assignees
Labels
Feature-Dependency-Node "Dependencies" node in Solution Explorer that display project, binary & package references Triage-Investigate Reviewed and investigation needed by dev team
Milestone

Comments

@drewnoakes
Copy link
Member

drewnoakes commented Mar 12, 2020

When a project sets property DisableTransitiveProjectReferences to true, the dependencies node should not display transitive project references.

Current

App.csproj

<PropertyGroup>
  <TargetFramework>netcoreapp3.1</TargetFramework>
  <DisableTransitiveProjectReferences>true</DisableTransitiveProjectReferences>
</PropertyGroup>
<ItemGroup>
  <ProjectReference Include="..\ClassLibrary1\ClassLibrary1.csproj" />
</ItemGroup>

ClassLibrary1.csproj

<ItemGroup>
  <ProjectReference Include="..\ClassLibrary2\ClassLibrary2.csproj" />
</ItemGroup>

App's Dependencies Tree

image

Expected

ClassLibrary2 does not appear as a child dependency of ClassLibrary1 in the App project.

@drewnoakes drewnoakes added Bug Feature-Dependency-Node "Dependencies" node in Solution Explorer that display project, binary & package references labels Mar 12, 2020
@drewnoakes drewnoakes added this to the 16.6 milestone Mar 12, 2020
@drewnoakes drewnoakes self-assigned this Mar 12, 2020
@davkean
Copy link
Member

davkean commented Mar 12, 2020

This is by design per the original design. This wasn't about showing things that the project inherits, just the dependencies that that upstream projects have.

As we spoke the other day, we should change this design not just for projects but also packages and stop showing other dependencies.

@drewnoakes
Copy link
Member Author

drewnoakes commented Mar 12, 2020

This was triggered in part by that conversation. My thinking was that parsing the assets file (being worked on in #3435) should address this problem.

However looking further into this it seems that ClassLibrary2 is listed as a dependency of ClassLibrary1 in project.assets.json even with this property set, so it may not be possible to fix this as part of that work. Changing the value of DisableTransitiveProjectReferences has no effect on the assets file (see also dotnet/msbuild#4717 (comment)).

@davkean
Copy link
Member

davkean commented Mar 12, 2020

That seems like a bug if had no effect, these transitive dependencies are stored in the assets file and that's how we add them to build.

@davkean
Copy link
Member

davkean commented Mar 12, 2020

@tmeschter tmeschter modified the milestones: 16.6, Backlog Mar 16, 2020
@tmeschter
Copy link
Contributor

@drewnoakes Is there a reason we need to do this (or might end up fixing it through other work) in 16.6?

@tmeschter tmeschter added the Triage-Investigate Reviewed and investigation needed by dev team label Mar 16, 2020
@drewnoakes
Copy link
Member Author

@tmeschter my hope is that this gets fixed as part of other work I'm doing. Specifically, a project reference's transitive dependencies will come from the assets file, not from the advertised references of the other project. If that's not the case, I'll move this back to triage with a suggestion for a different milestone.

@drewnoakes
Copy link
Member Author

The value of DisableTransitiveProjectReferences has no effect on the assets file, so there's nothing for us to do here. Closing for now. @davkean let me know if you think this should be filed against SDK/NuGet.

@davkean
Copy link
Member

davkean commented May 1, 2020

@drewnoakes I'm not sure I understand - what are you proposing the SDK changes to fix the display issue?

@drewnoakes
Copy link
Member Author

The tree shows what's in the assets file. My understanding is that the assets file should not contain the transitively-referenced-project due to DisableTransitiveProjectReferences being true. If that's so then the fix is to get the assets file to model this correctly, in which case the UI will update automatically.

@pzwara
Copy link

pzwara commented Jun 5, 2020

I would like to use DisableTransitiveProjectReferences to hide implementation\project references\nugets from referenced project and that the dependency of dependency won't be shown by intellisense in VS. Wasn't this flag made for it?

By using PrivateAssets = "All" I have System.IO.FileNotFoundException exceptions, because dll's are not copied.
So how can I separate / hide implementation details between different layers of application?

@drewnoakes drewnoakes removed the Bug label Oct 16, 2024
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-Investigate Reviewed and investigation needed by dev team
Projects
None yet
Development

No branches or pull requests

4 participants