I am looking for a way to find the default app domain in my process. Note than the current app domain may be different from the default one, for example when my code is running inside NUnit
.
I know that I can list all the app domains in the process using a COM interop trick shown in this answer, and pick the one for which IsDefaultAppDomain()
is true
. However, this seems like a heavyweight solution.
Is there a way to get the default appdomain that does not require filtering all the domains, preferably without going through COM interop?
Main
), and just look that up? – Vinaigrette