在Visual Studio中的另一个文件下分层显示文件 [英] Display a file hierarchically under another file in Visual Studio
问题描述
在Visual Studio中,我想显示某些文件之间的层次关系.
In Visual Studio, I'd like to show a hierarchical relationship between certain files.
一个典型的ASP.NET WebForms应用程序提供了我想要的示例.
假设我有一个名为Page.aspx
的文件.在解决方案资源管理器中,名为Page.aspx.cs
和Page.aspx.designer.cs
的文件通常会分层显示在Page.aspx
下方.
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.
推荐答案
如果要在解决方案资源管理器中将文件A分层显示在文件B下,请执行以下操作:
If you want File A to appear hierarchically under File B in Solution Explorer, do the following:
打开您的项目文件,转到文件A的<Content Include>
(或<None Include>
,或您拥有的)节点,然后向其中添加<DependentUpon>File B</DependentUpon>
子级.结果应类似于以下内容:
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>`
这篇关于在Visual Studio中的另一个文件下分层显示文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!