Visual Studio宏以选择启动项目

编程入门 行业动态 更新时间:2024-10-10 14:22:34
本文介绍了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宏以选择启动项目

本文发布于:2023-11-09 23:17:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1573711.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:项目   Visual   Studio

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!