【问题标题】:Display a file hierarchically under another file in Visual Studio [duplicate]在 Visual Studio 中的另一个文件下分层显示文件[重复]
【发布时间】:2015-10-04 14:51:15
【问题描述】:

在 Visual Studio 中,我想显示某些文件之间的层次关系。

一个典型的 ASP.NET WebForms 应用程序提供了我想要的示例。 假设我有一个名为Page.aspx 的文件。名为 Page.aspx.csPage.aspx.designer.cs 的文件通常会分层显示在解决方案资源管理器中的 Page.aspx 下方。

【问题讨论】:

    标签: visual-studio solution-explorer


    【解决方案1】:

    如果您希望文件 A 在解决方案资源管理器中分层显示在文件 B 下,请执行以下操作:

    打开您的项目文件,转到文件 A 的 <Content Include>(或 <None Include>,或者你有什么)节点并向其添加 <DependentUpon>File B</DependentUpon> 子节点。结果应该类似于:

    <Content Include="File A">
      <DependentUpon>File B</DependentUpon>
    </Content>`
    

    【讨论】:

    猜你喜欢
    • 2019-08-03
    • 2021-10-06
    • 2010-11-11
    • 2018-09-16
    • 1970-01-01
    • 2015-10-16
    • 2019-02-16
    • 2018-04-13
    • 2015-07-06
    相关资源
    最近更新 更多