Is it possible to enumerate the AppDomains currently executing and list the
loaded assemblies in each ?
Thanks for your time.
Assembly[] allAsm = AppDomain.CurrentDomain.GetAssemblies();
foreach( Assembly asm in allAsm )
{...}
AFAIK to enum all AppDoms, you have to use (unmanaged?) .NET Debug APIs /interfaces
--
NETMaster (Thomas Scheidegger)
http://www.cetus-links.org/oo_csharp.html
"Rajasekar Shanmugam" <s_raj...@yahoo.com> wrote in message news:OeAu0nZ9BHA.692@tkmsftngp04...
"NETMaster" <spam.ne...@swissonline.ch> wrote in message
news:e1IV2ma9BHA.2636@tkmsftngp05...
and code like:
// ================================================================
static void EnumAppDomainsAndAssemblies()
{
mscoree.CorRuntimeHostClass host = new mscoree.CorRuntimeHostClass();
IntPtr enumHandle = IntPtr.Zero;
host.EnumDomains( out enumHandle );
object dom = null;
while(true) {
host.NextDomain( enumHandle, out dom );
if( dom == null )
break;
AppDomain ad = (AppDomain) dom;
dom = null;
Console.WriteLine( "AppDomain: {0}", ad.FriendlyName );
Assembly[] allAsm = ad.GetAssemblies();
foreach( Assembly asm in allAsm )
Console.WriteLine( "\t{0}", asm.FullName );
ad = null;
}
host.CloseEnum( enumHandle );
int refctr = Marshal.ReleaseComObject( host );
host = null;
}
// ================================================================
--
NETMaster (Thomas Scheidegger)
http://www.cetus-links.org/oo_csharp.html
"NETMaster" <spam.ne...@swissonline.ch> wrote in message news:e1IV2ma9BHA.2636@tkmsftngp05...
> to list all assemblies:
> Assembly[] allAsm = AppDomain.CurrentDomain.GetAssemblies();
> foreach( Assembly asm in allAsm )
> {...}
> AFAIK to enum all AppDoms, you have to use (unmanaged?) .NET Debug APIs /interfaces
> "Rajasekar Shanmugam" <s_raj...@yahoo.com> wrote in message news:OeAu0nZ9BHA.692@tkmsftngp04...