I'm using the XmlSerializer constructor that asks for a Type object:
XmlSerializer mySerializer = new XmlSerializer(typeof(MyClass));
Why is it not the same to use the name of the class as a type? Like this:
XmlSerializer mySerializer = new XmlSerializer(MyClass);
The XmlSerializer constructor expects an instance of type System.Type for its parameter. The identifier MyClass doesn't correspond to an instance of anything; it's just the name of a class. The typeof keyword returns a System.Type instance that represents the type you specify (in this case, a System.Type instance that represents the MyClass class).