pappy
pappy

Reputation: 43

Accessing EnvDTE80.ProjectKinds.vsProjectKindSolutionFolder produces an Interop error

I am using Visual Studio 2017 Enterprise 15.7.5 I start a new VSIX project and add an AsyncPackage. Then I add the following line to the bottom of the InitializeAsync method.

var v = EnvDTE80.ProjectKinds.vsProjectKindSolutionFolder;

I get a red squiggle under ProjectKinds and the following error:

Interop type 'ProjectKinds' cannot be embedded. Use the applicable interface instead.

I look at the reference for EnvDTE80 and the "Embed Interop Types" is set to false.

So why do I get this error?

Upvotes: 0

Views: 250

Answers (1)

Carlos Quintero
Carlos Quintero

Reputation: 4414

Upgrade Microsoft.VisualStudio.SDK.EmbedInteropTypes to latest version 15.0.27. There was a bug in older versions that I reported to Microsoft that caused it to embed types of EnvDTE80, which is not possible because it contains classes. See comments on post https://blogs.msdn.microsoft.com/visualstudio/2018/10/10/simplify-extension-development-with-packagereference-and-the-vssdk-meta-package/

Upvotes: 2

Related Questions