Search code examples
.netvisual-studiovisual-studio-extensionsvsixvspackage

Developing a Visual Studio Extension for VS 2005+


I am developing a Visual Studio Extension the I would like to be compatible with VS 2005+(2005,2008,2010,2012,2013 and eventually 2015).

I have been looking into the requirements for this to be possible and came across this Manual on doing it http://www.viva64.com/en/a/0082/ . It covers a lot of the details on how to accomplish this, but I am lost when starting from scratch developing my first VS extension.

The Article says,

developing VS extension packages requires the installation of Microsoft Visual Studio SDK for a targeted version of IDE, i.e. a separate SDK should be installed with every version of Visual Studio for which an extension is being developed.

Does that mean I need the 2005 SDK, 2008 SDK, 2010 SDK, etc.?

Also, I don't see anything about what version of Visual Studio has to be used. I found some other articles that mentioned versions, but they were related to 2010+ extensions.

I am assuming I should use the .NET framework 3.5 for backwards compatibility.

I have the following questions:

  1. What version of Visual Studio I should create my project on?
  2. What version of the .NET framework I should target?
  3. What Visual Studio SDKs will be required?

Solution

  • It seems an arbitrary decision that you want your VS extension to be compatible with VS2005+. Why not VS2003+ or VS2008+?

    Anyway, this is possible but very difficult because VS has changed significantly since 2005. Debugging and testing and the extension can be a nightmare. You'll have to keep track of which features are supported by which VS version.

    To do this, you have to develop a VSPackage. The article you referenced discusses VSPackages but barely says anything about compatibility.

    Compatibility here cannot even be achieved at the source code level. According to this with important parts emphasized:

    Most VSPackages that work in Visual Studio 2005 will continue to work in Visual Studio 2008 without modification. Most services, entry points, and events maintain compatibility, but there are some exceptions, which are listed later in this topic. Programmatic interfaces also maintain compatibility generally, but elements of some interfaces may change and require source code modification to work with Visual Studio 2008.

    Even when Microsoft doesn't say anything about compatibility problems, they have been cases where things were working in previous versions but mysteriously became broken in later versions of Visual Studio.

    You'll have to use conditional compilation and compile the extension against each VS SDK version. Also the deployment model of the extension is different for different IDE versions.

    My recommendation is to target VS2010+ rather than VS2005. That would be significantly easier and most developers are using VS2010+ anyway.