I was working with WebView2 COM wrappers and encountered an issue where calling CoreWebView2.AddHostObjectToScript which produces the following output
System.NotSupportedException: Built-in COM has been disabled via a feature switch. See https://aka.ms/dotnet-illink/com for more information.
at System.Runtime.InteropServices.Marshal.GetNativeVariantForObject(Object obj, IntPtr pDstNativeVariant)
at WinFormsComInterop.WebView2.ICoreWebView2Wrapper.webview2::Microsoft.Web.WebView2.Core.Raw.ICoreWebView2.AddHostObjectToScript(String name, Object& object)
at Microsoft.Web.WebView2.Core.CoreWebView2.AddHostObjectToScript(String name, Object rawObject)
I assume COM wrappers source generator unintentionally emits a call into this method instead of using ComWrappers-specific code.