Easy VSIX get started?

青春壹個敷衍的年華 提交于 2019-12-11 08:40:11

问题


I've created some macros in VS 2010, I now want to migrate them so they are VSIXs and publish them in the gallery.

They are built on top of the DTE object instance provided in the VS macro editor.

How to implement this?

What is the replacement for the DTE object?

Update I also want to configure the extension so that when it's installed on the users machine, it should also install a keyboard shortcut that when pressed, it should run that method in the extension.
Note that currently I'm using a blank extension project, where there are no files except the code file that contains the method to be fired, and the .vsixmanifest file. I've posted a separated question of the above: How to make a shortcut to run a VSIX method?


回答1:


You can still reference DTE as a part of a VSIX extension. Just add a reference to the EnvDTE assembly. There's instructions here on how to get the object. If you have an IServiceProvider, you can also GetService(typeof(SDTE)) to get it.



来源:https://stackoverflow.com/questions/10367439/easy-vsix-get-started

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!