Link to home
Start Free TrialLog in
Avatar of Michael Lam
Michael Lam

asked on

Type.GetType returns null

i notice that if i have a class that i created within my current assembly, Type.GetType works.  But if it's a class located in an assembly that i am referencing, then i keep getting a null.  can someone tell me why this is the case and if there is any alternative to invoking an object:

myType = Type.GetType("TypeName");
                IMyType myObj = Activator.CreateInstance(myType) as IMyType;
Avatar of kaufmed
kaufmed
Flag of United States of America image

Use the fully qualified name. Something like:

   System.data, version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

http://msdn.microsoft.com/en-us/library/k8xx4k69.aspx
Avatar of Michael Lam
Michael Lam

ASKER

i did that but now i am getting:
 
Type adapterType = Type.GetType("SRT.HeartBeat.EAI.Adapter.FtpsAdapter, Version=3.1.655.3, Culture=neutral, PublicKeyToken=2d302914a71c7ad5");
 [System.IO.FileLoadException] = {"The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)":null}
ASKER CERTIFIED SOLUTION
Avatar of Gururaj Badam
Gururaj Badam
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks.