I've been getting an error during deserialization:
SerializationException: Could not find type 'System.Collections.Generic.List`1[[ExampleNamespace.ExampleClass, Assembly-CSharp, Version=0.1.6279.22118, Culture=neutral, PublicKeyToken=null]]'.
First I have serialized a custom [Serializable] class (saveStructure):
BinaryFormatter formatter = new BinaryFormatter();
FileStream file = File.Open(saveFilePath, FileMode.Open);
formatter.Serialize(file, saveStructure);
file.Close();
Which contains a few fields along with a List<ExampleClass>
field.
MyCustomClass is also a [Serializable] class.
It seems to serialize the structure properly, but can not read it back during deserialization:
BinaryFormatter formatter = new BinaryFormatter();
FileStream file = File.Open(saveFilePath, FileMode.Open);
SaveStructure saveStructure = (SaveStructure)formatter.Deserialize(file);
file.Close();
I am aware of XmlSerializer, however I do not want to expose the data to the users.
Thanks in advance!
Edit:
I have solved my problem by using Arrays instead of Lists, however, if someone is to offer a solution for the List problem, I'd still be grateful!