When a project sets property DisableTransitiveProjectReferences to true, the dependencies node should not display transitive project references.
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<DisableTransitiveProjectReferences>true</DisableTransitiveProjectReferences>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\ClassLibrary1\ClassLibrary1.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ClassLibrary2\ClassLibrary2.csproj" />
</ItemGroup>

ClassLibrary2 does not appear as a child dependency of ClassLibrary1 in the App project.
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.
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 https://github.com/microsoft/msbuild/issues/4717#issuecomment-533517583).
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.
Ah, you are right - this is implemented by the Assets resolver: https://github.com/dotnet/sdk/blob/f98197d56b051f8c5078e9017de1ef7046125205/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.PackageDependencyResolution.targets#L249 and not passed to NuGet.
@drewnoakes Is there a reason we need to do this (or might end up fixing it through other work) in 16.6?
@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.
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.
@drewnoakes I'm not sure I understand - what are you proposing the SDK changes to fix the display issue?
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.
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?
Most helpful comment
I would like to use
DisableTransitiveProjectReferencesto 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?