Re: dynamic class loading
From: Richard Blewett [DevelopMentor] (richardb_at_NOSPAMdevelop.com)
Date: 03/26/05
- Next message: Willy Denoyette [MVP]: "Re: Interop COM in C# - can't get the object released"
- Previous message: John Bailo: "Re: DTS execution fron C#"
- In reply to: KC Eric: "dynamic class loading"
- Next in thread: KC Eric: "Re: dynamic class loading"
- Reply: KC Eric: "Re: dynamic class loading"
- Messages sorted by: [ date ] [ thread ]
To: microsoft.public.dotnet.languages.csharp Date: Sat, 26 Mar 2005 02:21:08 -0800
Assembly a = Assembly.LoadFrom(<codebase of assembly>);
foreach( Type t in a.GetTypes() )
{
if( a.IsClass )
{
// Do stuff to class such as
object o = a.CreateInstance(t.FullName);
}
}
Obviously if you are interested in all types not just classes you can omit the if.
Regards
Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk
Hi all,
If someone has compiled a dll for the some classes,
and I want to use the dll in another project, how can I know the class
available in that dll file?
Thanks!
- Next message: Willy Denoyette [MVP]: "Re: Interop COM in C# - can't get the object released"
- Previous message: John Bailo: "Re: DTS execution fron C#"
- In reply to: KC Eric: "dynamic class loading"
- Next in thread: KC Eric: "Re: dynamic class loading"
- Reply: KC Eric: "Re: dynamic class loading"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|