[Mono-dev] Getting the list of all AppDomains in a process

Robert Jordan robertj at gmx.net
Fri Feb 12 05:19:52 EST 2010


On 12.02.2010 09:44, Lionel Cuir wrote:
> Hi All,
>
> I need to get a list of all loaded AppDomains in the running process
> (without asking developer to explicitely register them in a static hashtable
> for instance). In .NET on Windows, I can use COM Interop (see code below).
> But this is of course unlikely to run in Mono/Linux. Does anybody know how
> to do?

There is no way to enum AppDomains in Mono. Even the embedding API
(which is the counterpart of MS.NET's coree COM API) does not provide
a complete API for AppDomain enumerations [1].

But once AppDomainManager[2] is implemented in Mono, you'll have a
portable solution for domain enumerations. I don't know if this is
in the work.

Robert

[1] since there is no
     MonoAppDomain* mono_appdomain_from_domain (MonoDomain *dom)
     accessor in the embedding API, mono_domain_foreach can't
     be used to enum MonoAppDomains.

[2] see MSDN



More information about the Mono-devel-list mailing list