473,480 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

GAC and assembly types

I have a base interface named IBase. Two classes,
CChild1 and CChild2 implement IBase. CChild1 and CChild2
perform the same function but in different ways.

My client application needs to be able to choose either
CChild1 or CChild2 at runtime and create an object of the
class.

I haven't found any way to scan the GAC to see which
assemblies contain components which implement IBase.
Could anyone help me with this?

Paul K
Jul 21 '05 #1
1 1119
Are you sure you want to scan the entire GAC to find one assembly that
contains your classes (this would NOT be a fast process)?

A better way to do it would be to encapsulate the creation of those class in
some factory pattern. Then, in app.config, you would register the
assemblies and types that implement the interface. These would then be
loaded by your factory structure and be given to your application based on
some defined criteria.

Or you could just hardcode the construction in your application, but the
above makes it more flexible as you can add more classes without modifying
your application.
"Paul K" <sh********@yahoo.com> wrote in message
news:0a****************************@phx.gbl...
I have a base interface named IBase. Two classes,
CChild1 and CChild2 implement IBase. CChild1 and CChild2
perform the same function but in different ways.

My client application needs to be able to choose either
CChild1 or CChild2 at runtime and create an object of the
class.

I haven't found any way to scan the GAC to see which
assemblies contain components which implement IBase.
Could anyone help me with this?

Paul K

Jul 21 '05 #2

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

Similar topics

2
6383
by: Carlos G Benevides | last post by:
I have a ASP.Net web application that has two assemblies that run under com+. Under Windows 2000 the two assemblies are added to com+ automatically when instantiated from the web site. For this...
1
4294
by: Abdessamad Belangour | last post by:
Hi all, An assembly is composed of a set of modules. An Assembly and a Module classes have a GetTypes() methods. Moreover, an Assembly class has a GetExportedTypes() method. 1. This means that if...
2
4333
by: Sam Martin | last post by:
Morning all, Right, I've read untold articles now, listening to people bitch about there being no Unload method for Assembly. Plenty of people do counter that this is possible by loading the...
4
6070
by: Bruce W. Roeser | last post by:
All, I'm reading a book by Charles Petzold (Programming VS.Net). Pretty good content but am confused about the difference. From the text: ...
2
2293
by: Brad | last post by:
I have one of those seemingly simple questions that evades/confuses me. I've created an assembly with bass classes (classes meant to be inherited in other assemblys). In a secondary assembly (my...
6
44467
by: Steve | last post by:
I'm playing with late binding and trying a very simple test to load an assembly In my "Host" application I have this code: <code> string modulePath =...
6
2253
by: mookid8000 | last post by:
Hi group! Is it possible to scan an assembly *which has NOT been added as a reference* for types, and dynamically create instances of the loaded types? I have a program, MyProgram.exe, which...
3
3931
by: dfranzen | last post by:
Hi *, I'm in the process of porting an ANSI C++ project from a UNIX platform to .NET. After "getting rid of" some platform-specific stuff I managed to compile the first two libraries into mixed...
2
2156
by: Che.Gonzalez | last post by:
Can a project or assembly limit the projects that may reference it? For example, I have a legacy project used by a data layer project. I don't want the object model project to be able to directly...
3
2145
by: Peter | last post by:
Hi I can create types from dynamic loaaded assemblies (Assembly.Load) with Assembly.GetTyp( <typename) - OK I need a reference to the assembly (just Type.GetType() do not work ) now my...
0
7037
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6904
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7032
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7076
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5321
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4767
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
2990
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2976
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.