容易的VSIX入门吗? [英] Easy VSIX get started?

本文介绍了容易的VSIX入门吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在VS 2010中创建了一些宏,现在我想迁移它们,使其成为VSIX,并将其发布在图库中.

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

它们建立在 DTE 对象的顶部VS宏编辑器中提供的实例.

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

如何实现呢?

DTE 对象的替代品是什么?

What is the replacement for the DTE object?

更新 我还想配置该扩展程序,以便在将其安装在用户计算机上时,还应该安装一个键盘快捷方式,当按下该快捷键时,它应该在扩展程序中运行该方法.
请注意,当前我正在使用一个空白扩展项目,除包含要触发的方法的代码文件和 .vsixmanifest 文件外,没有其他文件. 我已经发布了上述内容的单独问题:如何做一个快捷方式来运行VSIX方法?

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?

推荐答案

您仍然可以将DTE引用为VSIX扩展的一部分.只需添加对EnvDTE程序集的引用即可. 此处物体.如果您有IServiceProvider,也可以通过GetService(typeof(SDTE))来获取它.

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.

这篇关于容易的VSIX入门吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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