本文介绍了Visual Studio宏以选择启动项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在MSVC中,一些操作(例如Menu:Build:Build)对于当前选择的解决方案项目是上下文相关的.但是,如果您一直在浏览解决方案资源管理器,则该项目通常会更改.
In MSVC several operations (such as Menu: Build: Build ) are context sensitive to the currently selected Solution Project. However, that Project often changes if you've been navigating Solution Explorer.
我想编写一个宏,以查找指定为启动项目"的项目,然后选择它以使其处于活动状态.我还没有找到合适的DTE呼叫.
I'd like to write a macro that find the project specified as the "startup project", and the selects it to make it active. I haven't found the appropriate DTE calls though.
推荐答案我的主要目标是建立启动项目,我找到了一个解决方案:
My primary goal was to build the startup project, which I have found a solution to:
Public Sub BuildStartupProject() Dim sb As SolutionBuild = DTE.Solution.SolutionBuild Dim projName As String = sb.StartupProjects(0) DTE.ExecuteCommand("View.Output") sb.BuildProject(sb.ActiveConfiguration.Name, projName, False) End Sub来自铬项目Wiki .
更多推荐
Visual Studio宏以选择启动项目
发布评论