Visual Studio宏以选择启动项目 [英] Visual Studio macro to select the startup project

查看:77
本文介绍了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宏以选择启动项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆