Sdílet prostřednictvím


Attributes for Importing Type Libraries into Interop Assemblies

The .NET Framework's COM interoperability mechanism provides four custom type library attributes to control the importation of type libraries into interop assemblies using the Type Library Importer (Tlbimp.exe). These custom attributes help keep type libraries in sync with the primary interop assemblies. They also allow backward compatibility with the functionality of Microsoft Visual Basic versions 5.0 and 6.0 without having to change interface definitions.

NoteNote

Use these custom attributes only if you are unable to change the definitions in your Interface Definition Language (IDL) file. The preferred method in such situations, if possible, is to make the fix in the IDL rather than use the custom attributes.

These custom attributes enable you to perform the following operations:

See Also

Reference

TypeLibConverter

ITypeLibConverter

Tlbimp.exe (Type Library Importer)

Concepts

Applying the custom Attribute to Implement IEnumerable

Applying the custom Attribute to Overwrite the Default COM Dispatch Identifier (DISPID)

Applying the custom Attribute to Tag Unmanaged COM Get/Set Properties

Importing a Type Library as an Assembly