[英]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 : 我有一个在vs2012中工作正常的vspackage,但当我将目标更改为4或3.5以定位旧版本时,我得到编译错误:
Error 17 The type or namespace name 'PackageRegistrationAttribute' could not be found (are you missing a using directive or an assembly reference?) 错误17找不到类型或命名空间名称'PackageRegistrationAttribute'(您是否缺少using指令或程序集引用?)
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 ? 并且没有为microsoft.visualstudio.shell.10.0和9添加引用。是否可以在vs2012中为旧版本创建vspackage? Thanks 谢谢
Rather than add a reference to the Visual Studio SDK assemblies directly, you can add the appropriate VSSDK.* NuGet packages to your project. 您可以将适当的VSSDK。* NuGet包添加到项目中,而不是直接添加对Visual Studio SDK程序集的引用。 For example, the Shell assembly you are looking for to target .NET 3.5 (Visual Studio 2008) is VSSDK.Shell.9 . 例如,您正在寻找的针对.NET 3.5(Visual Studio 2008)的Shell程序集是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 2010中包括.NET 4,所以它是极不可能的,你将需要建立针对.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. Visual Studio 2008及更早版本不支持VSIX文件来打包扩展,因此如果您想开发支持这些旧环境的扩展,那么您的工作将会真正减少。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.