在预构建事件上运行 Visual Studio 2008 宏 [英] Run Visual Studio 2008 Macro on Pre Build Event

查看:21
本文介绍了在预构建事件上运行 Visual Studio 2008 宏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Visual Studio 中创建了一些 Visual Studio 宏,它们从宏资源管理器和/或键盘快捷键运行.我想在构建前/构建后事件上自动运行这些,但在项目属性中看不到这样做的选项.谁能告诉我这是否可行,如果可以,怎么做?

解决方案

在你的宏中有 4 个构建事件可以挂钩:

  • OnBuildBegin-- 当从 IDE 触发任何构建操作时将触发.它只会触发一次获得完整的解决方案或多项目构建操作.

  • OnBuildDone -- 在构建操作完成时触发.对于完整的解决方案或多项目构建操作,此事件仅触发一次.

  • OnBuildProjConfigBegin -- 在项目构建时触发开始.此事件用于捕获解决方案或多项目构建操作中的每个项目构建事件.

  • OnBuildProjConfigDone -- 将触发当项目构建完成时.这事件用于捕获完成每个项目构建在解决方案或多项目中构建操作.

通用环境对象模型事件p>

I have some Visual Studio Macros created in visual studio which run from the macro explorer and/or keyboard shortcuts. I would like to run these automatically on pre/post build events but see no option to do so in the project properties. Can anyone tell me if this is possible and, if so, how?

解决方案

In your macro there are 4 build events you can hook into:

  • OnBuildBegin -- Will fire when any build operation is fired from the IDE. It fires only once for a full solution or multiproject build operation.

  • OnBuildDone -- Will fire when a build operation completes. This event fires only once for a full solution or multiproject build operation.

  • OnBuildProjConfigBegin -- Will fire when a project build begins. This event is used to catch each project build event within a solution or multiproject build operation.

  • OnBuildProjConfigDone -- Will fire when a project build completes. This event is used to catch the completion of each project build within a solution or multiproject build operation.

Common Environment Object Model Events

这篇关于在预构建事件上运行 Visual Studio 2008 宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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