If the assembly has been loaded in the current domain then the code below usually works:
public static Type GetTypeEx(string fullTypeName)
{
return Type.GetType(fullTypeName) ??
AppDomain.CurrentDomain.GetAssemblies()
.Select(a => a.GetType(fullTypeName))
.FirstOrDefault(t => t != null);
}
You can use it like so:
Type t = GetTypeEx("System.Net.Sockets.SocketException");