[英]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: 到目前为止,在线查看后,我发现:
http://msdn.microsoft.com/en-us/library/envdte.buildeventsclass.onbuilddone.aspx - This is the documentation for the BuildEventsClass.OnBuildDone Event. http://msdn.microsoft.com/en-us/library/envdte.buildeventsclass.onbuilddone.aspx - 这是BuildEventsClass.OnBuildDone事件的文档。 However, it says at the beggining that "This API supports the .NET Framework infrastructure and is not intended to be used directly from your code."
但是,它在开始时表示“此API支持.NET Framework基础结构,并不打算直接在您的代码中使用。”
Custom Build Tools in msBuild. msBuild中的自定义构建工具。 If I use this option, does my add-in have to be able to be run from the command line?
如果我使用此选项,我的加载项是否必须能够从命令行运行?
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.