GetType
actually queries a specific assembly (at runtime) for a type that might be defined within the assembly (Similar to new Object().GetType()
). typeof
on the other hand is determined at compile time.
For example:
// Nonsense. "Control" is not in the same assembly as "String"
Console.WriteLine(typeof(String).Assembly.GetType("System.Windows.Controls.Control"));
// This works though because "Control" is in the same assembly as "Window"
Console.WriteLine(typeof(Window).Assembly.GetType("System.Windows.Controls.Control"));