I renamed the class classBattle to Game and not I get “Unable to load type battle.classBattle+udtCartesian required for deserialization.”
This is the line of code MapSize = (Game.udtCartesian)formatter.Deserialize(fs);
How do I fix this? Does this mean I cannot rename classes?
BinaryFormatteris brittle, and is not designed to be friendly if you have changes to the types involved. If you want that type of behaviour, you need a contract-based serializer such asXmlSerializer,DataContractSerializeror protobuf-net. Anything exceptBinaryFormatter.