title: Why would Type.GetType() work and Assembly.GetType() not work?
body: <p>I'm trying to locate a type at runtime from a list of assemblies; my code is something like this:</p>
  
  <pre><code>foreach (Assembly assembly in assembliesToSearch)
  {
      Type t = assembly.GetType(assemblyName);
      if (t != null)
      {
          return t;
      }
  }
  </code></pre>
  
  <p>, and the problem that I have is that t is always coming up as null. Playing around with the debugger and the Intermediate window in VS2010, I noticed the following when I put a breakpoint inside the loop:</p>
  
  <pre><code>Type.GetType(typeof(MyNamespace.MyClass).AssemblyQualifiedName)
  </code></pre>
  
  <p>works OK, but</p>
  
  <pre><code>assembly.GetType(typeof(MyNamespace.MyClass).AssemblyQualifiedName)
  </code></pre>
  
  <p>does not (when assembly is the assembly that I know contains the class I'm looking for - in the debugger, I can put a watch on assembly.GetTypes(), browse to the class I'm trying to instantiate, and call assembly.GetType("MyNamespace.MyClass, MyNamespace")).</p>
  
  <p>Does anyone know why searching all assemblies using Type.GetType() works, but searching the assembly that I know contains the type using assembly.GetType() does not?</p>