In Visual Studio, I'd like to show a hierarchical relationship between certain files.
A typical ASP.NET WebForms application provides an example of what I want.
Say that I have a file named Page.aspx
. Files named Page.aspx.cs
and Page.aspx.designer.cs
would typically appear hierarchically below Page.aspx
in Solution Explorer.
Select the "Show the Supertype Hierarchy" from the toolbar to see a hierarchy showing the type's parent elements including implemented interfaces. This view shows the results in the reverse hierarchy.
The precedence for merging file nesting settings is: Visual Studio > Solution > Project. You can tell Visual Studio to ignore solution-specific and project-specific settings, even if the files exist on disk, by enabling the option Ignore solution and project settings under Tools > Options > ASP.NET Core > File Nesting.
Another new feature that catched my interest was the experimental support for file nesting. This feature lets you visually “nest”/group related files under a “root” file in the same directory. For example, say you have a main.ts file and next to it you have main.js , main.d.ts and main.js.map .
If you want File A to appear hierarchically under File B in Solution Explorer, do the following:
Open your project file, go to the <Content Include>
(or <None Include>
, or what have you) node for File A and add a <DependentUpon>File B</DependentUpon>
child to it. The result should look similar to this:
<Content Include="File A">
<DependentUpon>File B</DependentUpon>
</Content>`
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With