在Visual Studio中以编程方式打开项目时如何自动关闭或隐藏此asp.net主页窗口

问题描述 投票:0回答:1

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

enter image description here

c# asp.net-mvc visual-studio vsix vs-extensibility
1个回答
0
投票

这是使用开发工具环境对象可以完成的方法

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();
                }
            }
}
© www.soinside.com 2019 - 2024. All rights reserved.