Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating VSPackage targeting .net 3.5 and 4

I have a vspackage that works fine in vs2012, but when I change the target to 4 or 3.5 to target older version, I get compile error :

Error 17 The type or namespace name 'PackageRegistrationAttribute' could not be found (are you missing a using directive or an assembly reference?)

and there is no reference to be added for microsoft.visualstudio.shell.10.0 and 9 Is it possible to create a vspackage in vs2012 for older versions ? Thanks

like image 471
Albert Avatar asked Nov 13 '22 02:11

Albert


1 Answers

Rather than add a reference to the Visual Studio SDK assemblies directly, you can add the appropriate VSSDK.* NuGet packages to your project. For example, the Shell assembly you are looking for to target .NET 3.5 (Visual Studio 2008) is VSSDK.Shell.9.

Note that Visual Studio 2010 includes .NET 4, so it is highly unlikely that you will need to build against .NET 3.5. Visual Studio 2008 and earlier did not support VSIX files to package extensions, so you're really going to have your work cut out if you want to develop an extension supporting those older environments.

like image 160
Sam Harwell Avatar answered Nov 15 '22 00:11

Sam Harwell