Question:
public interface Interface1
{}
public interface Interface2:Interface1
{}
public class Foo:Interface2
{}
I want while creating new instance of Foo cast it into Interface1 so doing:
Interface1 i = (Interface1)new Foo;
i.FooMe();
Working fine, BUT
while reading Foo from assemblies like
Interface1 i =
(Interface1)Activator.CreateInstance(FooAssembly.G etType(FooAssembly.GetType().ToString()));
failed on "Invalid Cast".
Whide doing
Object o =
Activator.CreateInstance(FooAssembly.GetType(FooAs sembly.GetType().ToString()));
it rerurns me Foo
So why the cast is invalid???
TNX
--
Tamir Khason
You want dot.NET? Just ask:
"Please, www.dotnet.us "