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(m yType) as IMyType;
myType = Type.GetType("TypeName");
IMyType myObj = Activator.CreateInstance(m
ASKER
i did that but now i am getting:
Type adapterType = Type.GetType("SRT.HeartBea t.EAI.Adap ter.FtpsAd apter, Version=3.1.655.3, Culture=neutral, PublicKeyToken=2d302914a71 c7ad5");
[System.IO.FileLoadExcepti on] = {"The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)":null}
Type adapterType = Type.GetType("SRT.HeartBea
[System.IO.FileLoadExcepti
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks.
System.data, version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c56193
http://msdn.microsoft.com/en-us/library/k8xx4k69.aspx