Using Type.GetType(typeName)

If no assembly is specified, Type.GetType() will only look in the calling assembly and then mscorlib.dll for the type. For it to look in any other assembly, you need to give the Type.AssemblyQualifiedName for the type. For example:

Type.GetType(“System.Uri, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”);

This is because part of the type identity is its assembly. We don’t check for it in all of the assemblies in the appdomain because (a) that would be bad for performance and (b) it’s legal to use multiple types with the same name, but from different assemblies. In that case, we wouldn’t know which one is the right one to return. So, it’s always required to specify the assembly or else we will only make limited guesses.

Of course, if you would rather not supply the assembly display name, you can call Assembly.GetType() or typeof() instead.

Comments (5)

  1. Andrew says:

    Is there a way to specify which assembly but not which version? I’m using reflection to get at InputPanel in Microsoft.WindowsCE.Forms in the compact framework while keeping desktop execution working, and I want a way to say "get this type from this dll or any newer version." It works for the CF installed on one of my PocketPC’s, but not the other, presumably because of a newer CF.

  2. chris.katsuo says:


    Is it possible to load a Type which is located in an assembly which is not in the bin folder from the value previously retrieved from Type.AssemblyQualifiedName.

    Ex :


    load the Class1 into TestPlugin1.dll

    from the string

    TestPlugin1.Class1, TestPlugin1, Version=, Culture=neutral, PublicKeyToken=null

    Thanks in advance for your help


  3. Jordan Sehn says:

    The royal WE is being used above indicating your on that team that owns this feature.  Shouldn’t the above comments be part of the docs on msdn?  I don’t seem to see them

  4. citykid says:

    Dear (royal) Suzanne

    This post was very helpful for me. Now, in this second, I debug my Visual Studio Package and have this assembly layout:


    –> Language

       –> BunnyCore.dll in GAC !!!

    In the Language assembly I say

    Type t = Type.GetType("Carrots.Bunny");

    so fulltypename but no assembly is given, and I get back the correct type that refers to the assembly in the GAC !??

    Considering your (reasonable) algorithm above, I should get null. Thank you for clarification.

  5. Sung Kim says:

    Have you already considered the RowEditTemplate and Templated Column features but would rather use a