I need to create multiple AppDomains in my .NET in-process COM server (it's a Windows Explorer namespace extension).
In my test Console Application, i am able to create 10 domains + WPF windows in 40 seconds, which is unacceptable.
Adding LoaderOptimization.MultiDomainHost
speeds this up to 2-5 seconds, which is OK.
However, there is no Main
method in a COM server, and specifying LoaderOptimization in AppDomainSetup
only affects loading 2 or more additional domains (i.e. first additional AppDomain starts 3-4 seconds, others in 0.1-0.3 sec)
So, Can I specify LoaderOptimization
for an in-process COM server, and if yes, how?