e: How to extract full type name from assembly qualified name

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



"John Brown" <no_spam@xxxxxxxxxxx> wrote in message news:#QfeghQrHHA.2368@xxxxxxxxxxxxxxxxxxxxxxx
Hi there,

Does anyone know how to extract the full type name ("namespace.type") from an assembly qualified name. Thanks.


The following works in v1.1 (And should work in all later versions and possibly even earlier one too):

string qualType =
@"System.String, mscorlib, Version=2.0.0.0, " +
@"Culture=neutral, PublicKeyToken=b77a5c561934e089";

Type t = Type.GetType(qualType, false);

if (t == null) {
Console.WriteLine("Invalid qualified type string.");
return;
}

Console.WriteLine(t.FullName);


HTH :)

Mythran


.