473,322 Members | 1,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

reflection to get classes that implement interface in current assembly

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!
Sep 11 '06 #1
2 2266
>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.
Sep 11 '06 #2
thanks just found that before i read ur message!

"Mattias Sjögren" <ma********************@mvps.orgwrote in message
news:eS**************@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.

Sep 11 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Sunny | last post by:
Hi, I have an old problem which I couldn't solve so far. Now I have found a post in that group that gave me an idea, but I can not fully understand it. The problem is: I'm trying to use a...
2
by: cv | last post by:
Hi, I want to create an object from a class I load from an assembly. Then I want to cast that object to a class (an interface) 'known' to the program in order to pass it to other methods that work...
6
by: MrNobody | last post by:
How would you handle this situation: I have a series of classes which are to be later loaded using reflection: but the class to be used can vary depending on strings from a text file. So this...
12
by: Antony | last post by:
Hello - I am wanting to print out a "Yes" next to classes that implement "Interface01", otherwise a "No". Here is my code. It crashes with a null reference exception and I am not sure why. Ideas?...
9
by: TS | last post by:
i have code that creates assemblies and classes from the assemlby and methods from the classes to set properties of dynamically created controls. How i should go about validating the assemblies,...
2
by: admin | last post by:
I am trying to get reflection to work and have been spending today trying to understand it better. I am stuck and hoping someone could point me in the right direction (maybe a different way of...
3
by: binder.christian | last post by:
Hi! I have two applications: * mainapp.exe * plugin01.exe I have 2 "friend" variables in mainapp.exe: Friend gblConn as SqlConnection Friend gblPath as string
7
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
I have a C# logging assembly with a static constructor and methods that is called from another C# Assembly that is used as a COM interface for a VB6 Application. Ideally I need to build a file...
6
by: Cralis | last post by:
Hi guys, Someone once said, 'You can do that with reflection'. I can't recall what it was I was trying to do at the time, but then he said, 'Any developer knows what reflection is...'. I kept...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.