为多个版本的Visual Studio开发Visual Studio加载项 [英] Developing Visual Studio addins for multiple versions of Visual Studio

查看:146
本文介绍了为多个版本的Visual Studio开发Visual Studio加载项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经承担了为Visual Studio开发一些扩展以供内部使用的任务.这些将必须支持几个不同版本的Visual Studio(VS2008、2010和2012-VS2005不错,但不是必需的).我想以尽可能一致的方式开发这些代码,重用尽可能多的代码,同时将其适合这些工具的现有项目结构,即Visual Studio 2012 .sln.

I've been given the task of developing some extensions for Visual Studio for our internal use. These will have to support a couple of different versions of Visual Studio (VS2008, 2010 and 2012 - VS2005 would be a nice to have but not essential). I'd like to develop these in as consistent a way as possible, reusing as much of the code as possible, while fitting it into the existing project structure for these kinds of tools, which is a Visual Studio 2012 .sln.

开发这种扩展的最好/最简单的方法是什么? VSPackage项目?我可以制作在VS2012中开发的2008兼容的VSPackage吗?

What's the best / easiest way of developing this kind of extension? A VSPackage project? Can I make a 2008-compatible VSPackage which is developed in VS2012?

我目前正在编写的扩展程序所需的功能非常基本-我需要创建工具"菜单命令,可能需要自定义工具窗口.我的要求可能会在以后更改,但目前不需要编辑器修饰或类似的东西.

The features I will need for the extensions I'm writing at the moment are pretty basic - I need to create Tools menu commands, possibly a custom toolwindow. My requirements might change later on but I don't need editor adornments or anything like that at the moment.

我看到了这个问题,看起来似乎重复,但是被接受的答案不能回答问题,所以...

I saw this question which might seem to be a duplicate, but the answer which was accepted doesn't answer the question, so...

推荐答案

这实际上取决于您的扩展程序要做什么.

It really depends on what is your extension going to do.

VS2008不支持扩展名(.vsix),因此您需要为其编写部署为msi的VSPackage.您也将无法访问VS2010中引入的许多新功能(更轻松的编辑器集成以及通过MEF访问vs服务),但是诸如处理解决方案/项目/文件之类的基本功能应该可以并且可以在所有版本上使用(例如,使用 DTE 应该可以).

VS2008 does not support extensions (.vsix) and you will need to write VSPackage deployed as msi for it. You also won't have access to many new features introduced in VS2010 (easier editor integration and access to vs services via MEF), but basic stuff such as manipulating solution/project/files should be fine and work on all versions (e.g. using DTE should be ok).

据我所记得的VS2008,您还需要

As far as I remember for VS2008 you will also need to obtain a PLK, which is no longer required for 2010 and 2012.

我还没有尝试在VS2012中开发2008软件包,但是您绝对可以在2012年开发2010扩展.

I haven't tried developing 2008 package in VS2012, but you definitely can develop 2010 extension in 2012.

还请记住,VS2008是.Net 3.5,因此您的代码应使用.net 3.5和它支持可移植的c#版本.

Also remember that VS2008 is .Net 3.5, so your code should use .net 3.5 and version of c# which it supports to be portable.

这篇关于为多个版本的Visual Studio开发Visual Studio加载项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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