在 Visual Studio 2008 中构建特定解决方案后,有没有办法运行外部可执行文件?

发布于 2024-07-11 22:34:42 字数 451 浏览 4 评论 0原文

我有同样的问题 这个线程,即我正在寻找一种在 Visual Studio 中构建解决方案后运行可执行文件或脚本的方法。

我尝试了使用宏捕获 OnBuildDone 事件的建议解决方案,该解决方案(据我所知)需要放置在宏 IDE 中 MyMacros 下的 EnvironmentEvents 部分中。 这样做的问题是,它使宏对于我在 Visual Studio 中所做的所有操作都是全局的。 换句话说,无论我正在构建哪种解决方案,它都会运行宏。 但是,我只希望它为该一种解决方案运行。

有没有办法制作一个宏来仅捕获特定解决方案的 OnBuildDone 事件?

I had the same question as was asked in this thread, i.e. I was looking for a way to run an executable or script after building a solution in Visual Studio.

I tried out the suggested solution of catching the OnBuildDone event with a macro, which (as I understand it) needs to be placed in the EnvironmentEvents section under MyMacros in the Macros IDE. The problem with this is that it makes the macro global to everything I do in Visual Studio. In other words, it runs the macro regardless of which solution it is that I am building. However, I only want it to run for that one solution.

Is there a way to make a macro that catches the OnBuildDone event for a specific solution only?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

腻橙味 2024-07-18 22:34:42

一种方法是:

  • 在该解决方案中定义一个新的、失败的空项目
  • 指定该新项目依赖于所有其他项目(以便该新项目将在所有其他项目之后构建)
  • 调用您的可执行文件或脚本作为构建这个新项目的事件(而不是解决方案)

One way to do it is:

  • Define a new, faily empty, project within that solution
  • Specify that this new project depends on every other project (so that this new project will be built after all other projects)
  • Invoke your executable or script as a build event of this new project (instead of, of the solution)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文