Exposing COM Components to the .NET Framework

To expose COM components to the .NET Framework

  1. 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.

  2. Create 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.

  3. Compile an interop project.

    The .NET Framework SDK provides compilers for several languages compliant with the Common Language Specification (CLS), including Visual Basic .NET, C#, and the Managed Extensions for C++.

  4. Deploy an interop application.

    Interop applications are best deployed as strong-named, signed assemblies in the global assembly cache.

原文地址:https://www.cnblogs.com/MayGarden/p/1630959.html