To serialize one object, its class must have one constructor with paramless. Otherwise, TypeInitializationException will be thrown to prompt you add such a constructor.