简体   繁体   English

创建针对.net 3.5和4的VSPackage

[英]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.

相关问题 在Monodevelop中使用C#6定位.net 3.5 - Targeting .net 3.5 with C# 6 in monodevelop 尝试将针对.NET 3.5的项目添加到针对.NET 4.0的现有项目 - Trying to add a project targeting .NET 3.5 to an existing project targeting .NET 4.0 您可以在面向.NET 3.5的代码中使用可选参数吗? - Can you use optional parameters in code targeting .NET 3.5? WPF 以 .NET 4.5 为目标,但 Windows 要求在应用程序运行时安装 .NET 3.5 - WPF targeting .NET 4.5 but windows asking to install .NET 3.5 when the app run 在ASP.NET 3.5中创建RSS源 - Creating an RSS feed in ASP.NET 3.5 在.NET 3.5中为Windows服务创建自定义安装 - Creating custom install for windows service in .NET 3.5 由于引用了针对.Net Framework 3.5的程序集,因此无法加载文件或程序集版本为2.0.5.0的系统 - Could not load file or assembly System, Version=2.0.5.0 due to the referenced assembly targeting .Net Framework 3.5 在面向.NET 3.5的Winforms上使用Google Calendar API客户端库v3? - Use Google Calendar API Client Library v3 on Winforms targeting .NET 3.5? 为什么IndexOf在我的数组中不可用? 我的目标是.Net 3.5 - Why would IndexOf be unavailable in my array? I'm targeting .Net 3.5 c# - 错误编译目标Compact Net Framework 3.5 - 方法'GetString'的重载没有'1'参数 - c# - error compiling targeting Compact Net Framework 3.5 - No overload for method 'GetString' takes '1' arguments
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM