【问题标题】:How to Auto close or hide this asp.net home page window when opened the project in visual studio programmatically以编程方式在 Visual Studio 中打开项目时如何自动关闭或隐藏此 asp.net 主页窗口
【发布时间】:2020-02-19 01:28:31
【问题描述】:

如何关闭或隐藏此页面?我创建了一个自定义项目模板,它输出 asp.net mvc 项目或 aspnet 核心模板,并将此页面作为选项卡式文档打开。如何以编程方式关闭它?

【问题讨论】:

    标签: c# asp.net-mvc visual-studio vsix vs-extensibility


    【解决方案1】:

    这就是如何使用开发工具环境对象来完成的

    public void RunFinished()
            {
               Solution2 soln = (Solution2)dte.Solution;
    //Close the .Net project overview home page from the output project to be created
                foreach (Window documentWindow in dte.Windows)
                {
                    //close all Document type of windows from the output project
                    if (documentWindow.Kind == "Document")
                    {
                        documentWindow.Close();
                    }
                }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-05-24
      • 2021-11-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多