A
Antao Almada
I was having some problems with the Type.GetType() method and did some
tests. I called the method several times in this order:
// using type name only
Type t1 = Type.GetType("YDreams.iGarment.Messaging.MapListRequest"); //
fails
// using type name and assembly name
Type t2 = Type.GetType("YDreams.iGarment.Messaging.MapListRequest,
YDreams.CF.iGarment.Messaging"); // fails
// explicitly load the assembly
Assembly test = Assembly.LoadFrom("YDreams.CF.iGarment.Messaging.dll");
// using type name only
Type t3 = Type.GetType("YDreams.iGarment.Messaging.MapListRequest"); //
fails
// using type name and assembly name
Type t4 = Type.GetType("YDreams.iGarment.Messaging.MapListRequest,
YDreams.CF.iGarment.Messaging"); // succeeds
Conclusion:
It only succeeds after the assembly is explicitly loaded and using both
the type name and assembly name. Wierd...
Just in case anyone has the same problem...
Antao
____________________________
Antao Almada
http://www.ydreams.com/
tests. I called the method several times in this order:
// using type name only
Type t1 = Type.GetType("YDreams.iGarment.Messaging.MapListRequest"); //
fails
// using type name and assembly name
Type t2 = Type.GetType("YDreams.iGarment.Messaging.MapListRequest,
YDreams.CF.iGarment.Messaging"); // fails
// explicitly load the assembly
Assembly test = Assembly.LoadFrom("YDreams.CF.iGarment.Messaging.dll");
// using type name only
Type t3 = Type.GetType("YDreams.iGarment.Messaging.MapListRequest"); //
fails
// using type name and assembly name
Type t4 = Type.GetType("YDreams.iGarment.Messaging.MapListRequest,
YDreams.CF.iGarment.Messaging"); // succeeds
Conclusion:
It only succeeds after the assembly is explicitly loaded and using both
the type name and assembly name. Wierd...
Just in case anyone has the same problem...
Antao
____________________________
Antao Almada
http://www.ydreams.com/