Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Note
This article describes .NET Framework COM interop guidance that uses legacy tools and deployment models, such as primary interop assemblies, the global assembly cache, and registry-based COM registration. For modern .NET, use COM source generation or the ComWrappers API. For more information, see COM interop.
This section summarizes the process needed to expose an existing COM component to managed code.
Existing COM components are valuable resources in managed code as middle-tier business applications or as isolated functionality. An ideal component has a primary interop assembly and conforms tightly to the programming standards imposed by COM.
Expose COM components to .NET
Import a type library as an assembly.
The common language runtime requires metadata for all types, including COM types. There are several ways to obtain an assembly containing COM types imported as metadata.
Use COM types in managed Code.
You can inspect COM types, activate instances, and invoke methods on the COM object the same way you do for any managed type.
-
The Windows SDK provides compilers for several languages compliant with the Common Language Specification (CLS), including Visual Basic, C#, and C++.
Deploy an interop application.
For .NET Framework, interop applications are often deployed as strong-named, signed assemblies in the global assembly cache.