Tuesday, August 10, 2010

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

Typically, to change your code to use an interface type instead of a class type you just need to remove the 'Class' suffix and compile the code! Another way to find what the applicable interface is - look at the definition of the class type. The class usually derives from one or more interfaces. Look at the definition of each interface - one of them will have CoClass attribute and this is the interface that you are looking for.
The case with EnvDTE/VSLangProj is a little bit different. I believe there should be a recommendation coming from the VSIP team encouraging to use Type Embedding. Unfortunately, some constants in the EnvDTE/VSLangProj  assemblies cannot be embedded. For these you will need manually embed the values of the constant into your project.Since those are constant fields in the abstract classes and should never change - this is a safe thing to do.

Reference

No comments:

Azure Storage Account Types

Defferent Types of Blobs Block blobs store text and binary data. Block blobs are made up of blocks of data that can be managed individually...