I have two assemblies that share some classes with the same name (that's
the fully qualified name that includes the namespace as well as the class
name).  At certain points in the program, I would like to use, say, class X
in assembly A1, and at other points in the program I would like to use
class X in assembly A2.  (Let's assume that the names have been handed to
me and I can't change them.  Let's also assume that the two classes X do
different things, so there's a reason I might want to do this.)  Compiling
and linking the programs works ok -- the linker chooses one assembly or the
other, and I know there are ways to override this choice at link time, but
any choice that's made applies to all the instances of X in my program --
it doesn't allow me to specify X in A1 in some places, and X in A2 at
others.

Now, the Type class has the notion of an "assembly-qualified name" that
includes the assembly in which the type definition appears (e.g., X,A1 and
X,A2), but I don't see any way to use it outside of reflection (e.g.,
Type.GetType()).  Is there any way I can use the assembly-qualified name in
C# program source instead of the more usual fully-qualified name?

It would be nice if I could do something like:

X,A1 x1 = new X,A1();
X,A2 x2 = new X,A2();

I've tried and can't find a way to do this, but maybe I'm missing
something.

Thanks in advance for your help.

Wayne

____________________________________

Wayne Citrin
JNBridge, LLC
[EMAIL PROTECTED]
www.jnbridge.com
Spanning the Worlds of Java and .NET
____________________________________

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to