V
Vincent Lascaux
Hello,
I have two assemblies A and B and an IFoo empty interface
In the assembly B there is the following code :
namespace B
{
public class Foo : IFoo { }
}
In the assembly A there is :
namespace A
{
public class Bar
{
Assembly a = Assembly.LoadFrom("B.dll");
Type FooType = a.GetType("B.Foo");
IFoo foo = (IFoo)Activator.CreateInstance(FooType); // Error
}
}
I get the following run time error : (sorry, it may not be the exact words
since I translate from french)
An unhandled exception of type 'System.InvalidCastException' has happened in
A.exe
The specificated cast spécifié is not valid.
Can you help me ?
Thanks
I have two assemblies A and B and an IFoo empty interface
In the assembly B there is the following code :
namespace B
{
public class Foo : IFoo { }
}
In the assembly A there is :
namespace A
{
public class Bar
{
Assembly a = Assembly.LoadFrom("B.dll");
Type FooType = a.GetType("B.Foo");
IFoo foo = (IFoo)Activator.CreateInstance(FooType); // Error
}
}
I get the following run time error : (sorry, it may not be the exact words
since I translate from french)
An unhandled exception of type 'System.InvalidCastException' has happened in
A.exe
The specificated cast spécifié is not valid.
Can you help me ?
Thanks