Hi!

I have a project with a Dll and a exe. My dll has a set of functions that
can activate some classes (these classes have all the same interface defined
in the dll). That works fine with classes that are defined inside the Dll,
but when I want to activate a class defined in my exe (which references the
dll) the Type cannot get loaded. Is there any way to
Type.GetType("classname.of.class.in.exe")-Create a Type in a function of the
Dll?

matthias

Re: How to Activator.CreateInstance a Type from within an other assembly? by Jon

Jon
Fri Jan 09 12:26:12 CST 2004

Matthias Straka <nospam@notaserver.domain> wrote:
> I have a project with a Dll and a exe. My dll has a set of functions that
> can activate some classes (these classes have all the same interface defined
> in the dll). That works fine with classes that are defined inside the Dll,
> but when I want to activate a class defined in my exe (which references the
> dll) the Type cannot get loaded. Is there any way to
> Type.GetType("classname.of.class.in.exe")-Create a Type in a function of the
> Dll?

You need to either get the assembly (either by finding it in the
already-loaded assemblies in the AppDomain, or loading it with
Assembly.Load) and call Assembly.GetType, or use GetType with the fully
qualified name of the type, including assembly information.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too