Visual Studio 2017扩展开发

时间:2017-11-29 14:24:18

标签: c# visual-studio-2017 visual-studio-extensions

您好我想将我的扩展程序升级到Visual Studio 2017,但我遇到Microsoft.VisualStudio.Shell.RegistrationAttribute错误,但我已经添加了此引用?我在编译时遇到此错误。是否有任何参考要添加?对此有何评论?

D:\Visual Studio 2017\VSSDK\VisualStudioIntegration\Common\Assemblies\v4.0\Microsoft.VisualStudio.Shell.Immutable.10.0.dll ,version :10.0.0.0

我的错误是

Severity    Code    Description Project File    Line    Suppression State
Error       CreatePkgDef : error : ArgumentException: No Visual Studio registration attribute found in this assembly.           
Severity    Code    Description Project File    Line    Suppression State
Error       The assembly should contain an instance of the attribute 'Microsoft.VisualStudio.Shell.RegistrationAttribute' defined in assembly 'Microsoft.VisualStudio.Shell.Immutable.10.0' version '10.0.0.0'  
Severity    Code    Description Project File    Line    Suppression State
Error       at Microsoft.VisualStudio.Tools.CreatePkgDef.ProcessAssembly(String fileName, Hive hive, PkgDefContext context, Boolean register, RegistrationMode mode) in f:\dd\src\vssdk\VSIntegration\Tools\src\CreatePkgDef\CreatePkgDef.cs:line 303

2 个答案:

答案 0 :(得分:1)

最终我找到了解决方案,我删除了Microsoft.VisualStudio的所有引用。****,之后我在visual studio 2017中添加了一个新的vsix,那时我从nuget下载所有包,我的项目现在编译

答案 1 :(得分:0)

像下面在csproj文件中一样,将GeneratePkgDefFile添加为false

<GeneratePkgDefFile>false</GeneratePkgDefFile>