Visual Studio looks for and uses a primary interop assembly the first time that you reference a type from a COM type library. You must register all acquired primary interop assemblies on your development computer before you can reference them with Visual Studio. When your application requires such insulation, generate your own interop assembly instead of using the primary interop assembly. However, this strategy provides no insulation from changes a vendor might make to types defined in a primary interop assembly. In addition to providing guaranteed type compatibility, primary interop assemblies are often customized by the vendor to enhance interoperability.Įven if you do not plan to expose third-party COM types, using the primary interop assembly can ease the task of interoperating with COM components. If you plan to expose third-party COM types to other applications, always use the primary interop assembly provided by the same publisher as the type library it defines. The solution to this type incompatibility problem is for each developer to obtain the vendor-supplied and signed primary interop assembly. Each time a developer imports and signs a COM type library, that developer creates a set of unique types that are incompatible with those imported and signed by another developer. NET Framework application can generate an interop assembly, doing so creates a problem. For information about overriding the class interface with an interface of your choice, see COM Callable Wrapper.Īlthough any developer who wants to use COM types from a. In some cases the interface used to marshal the class is known as the class interface. How to: Register Primary Interop AssembliesĬlasses can be marshaled only by COM interop and are always marshaled as interfaces.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |