COM Interop in .NET

The Component Object Model (COM) lets an object expose its functionality to other components and to host applications on Windows platforms. To help enable users to interoperate with their existing code bases, .NET Framework has always provided strong support for interoperating with COM libraries. In .NET Core 3.0, a large portion of this support has been added to .NET Core on Windows. The documentation here explains how the common COM interop technologies work and how you can utilize them to interoperate with your existing COM libraries.

Built-in and source-generated COM interop

COM interop functionality can be achieved through a built-in system in the .NET runtime or through implementing the ComWrappers API (introduced in .NET 6). Starting in .NET 8, you can use the COM source generator to automatically implement the ComWrappers API for IUnknown-based interfaces.