Visual Studio 2017 Extension Development

自古美人都是妖i 提交于 2021-01-04 06:10:25

问题


Hi I want to upgrade my extension to visual studio 2017 but I got Microsoft.VisualStudio.Shell.RegistrationAttribute error, but I have been already added this reference?I got this error in compile time. Is there any reference to be added or else? Any comment about that?

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

My Error is

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

回答1:


Add GeneratePkgDefFile as false like below in the csproj file

<GeneratePkgDefFile>false</GeneratePkgDefFile>



回答2:


Finaly I found the solution,I remove all references of Microsoft.VisualStudio.****,after than I add my project a new vsix in visual studio 2017 that time I download all packages from nuget and my project is compile now.



来源:https://stackoverflow.com/questions/47555049/visual-studio-2017-extension-development

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!