简体   繁体   English

Visual Studio - 在生成后自动运行外接程序

[英]Visual Studio - Make Add-in run automatically after build

I have ac# add-in that I would like to run automatically after a user builds a solution. 我有一个ac #add-in,我希望在用户构建解决方案后自动运行。 Is there a possible way to implement this? 有可能实现这个吗?

So far, after looking online, I've found: 到目前为止,在线查看后,我发现:

I think you've found two valid solutions. 我想你找到了两个有效的解决方案。 If your tool is a plug-in to visual studio, you can use the first method. 如果您的工具是visual studio的插件,则可以使用第一种方法。 Don't worry about the warning, that's saying you can't call it from your application code. 不要担心警告,说你不能从你的应用程序代码中调用它。 But you _ can_ call it from a macro project, or other code designed to extend visual studios capabilities. 但是你可以从宏项目或其他旨在扩展视觉工作室功能的代码中调用它。 . Go up a few levels in the doc tree at the link you gave and read about extending the development environment. 在您提供的链接的文档树中上几级,阅读有关扩展开发环境的信息。

On the other hand, if your add-on does have a command line interface, the 2nd method is an extremely easy to add a step to your build. 另一方面,如果您的加载项确实有一个命令行界面,那么第二种方法非常容易为您的构建添加一个步骤。 I always do it this way. 我总是这样做。

您可以实现IVsUpdateSolutionEvents并与注册IVsSolutionBuildManager挂钩到生成的事件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM