问题
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