You can inherit from StandardOleMarshalObject
or ServicedComponent
for that effect:
Managed objects that are exposed to COM behave as if they had aggregated the free-threaded marshaler. In other words, they can be called from any COM apartment in a free-threaded manner. The only managed objects that do not exhibit this free-threaded behavior are those objects that derive fromĀ ServicedComponent or StandardOleMarshalObject.