Home All Groups Group Topic Archive Search About

reflection to get classes that implement interface in current assembly

Author
11 Sep 2006 3:17 PM
Smokey Grindle
I am already doing this inside the main assembly that is executing, but I
want to get a list of all the classes inside itself that implement a certain
interface and make a list of them so I can instanciate them as an object.
How would I go about doing this without reloading the assembly? thanks!

Author
11 Sep 2006 6:32 PM
Mattias Sjögren
>I am already doing this inside the main assembly that is executing, but I
>want to get a list of all the classes inside itself that implement a certain
>interface and make a list of them so I can instanciate them as an object.
>How would I go about doing this without reloading the assembly? thanks!

Assembly.GetExecutingAssembly will return a reference to the currently
executing assembly.


Mattias

--
Mattias Sjögren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Author
11 Sep 2006 7:10 PM
Smokey Grindle
thanks just found that before i read ur message!

Show quoteHide quote
"Mattias Sjögren" <mattias.dont.want.spam@mvps.org> wrote in message
news:eSsCzBd1GHA.1132@TK2MSFTNGP02.phx.gbl...
>
>>I am already doing this inside the main assembly that is executing, but I
>>want to get a list of all the classes inside itself that implement a
>>certain
>>interface and make a list of them so I can instanciate them as an object.
>>How would I go about doing this without reloading the assembly? thanks!
>
> Assembly.GetExecutingAssembly will return a reference to the currently
> executing assembly.
>
>
> Mattias
>
> --
> Mattias Sjögren [C# MVP]  mattias @ mvps.org
> http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
> Please reply only to the newsgroup.