Edit

IL3052: COM interop is not supported with full ahead of time compilation

Cause

Built-in COM is not supported with Native AOT compilation. Use COM wrappers instead.

When the unsupported code path is reached at runtime, an exception will be thrown.

Example

using System.Runtime.InteropServices;

// AOT analysis warning IL3052: CorRuntimeHost.CorRuntimeHost(): COM interop is not supported
// with full ahead of time compilation.
new CorRuntimeHost();

[Guid("CB2F6723-AB3A-11D2-9C40-00C04FA30A3E")]
[ComImport]
[ClassInterface(ClassInterfaceType.None)]
public class CorRuntimeHost
{
}