Reputation: 51
StringBuilder sb = new StringBuilder();
Why did Mono generate a warning when I use it?
Mono Limitation : Serialization format not compatible with .NET
Unity 5.5.2 And Visual Studio in Mac.
My English is very poor, please understand, thank you.
Upvotes: 4
Views: 727
Reputation: 316
Short answer: You can probably safely ignore this warning in your own Unity3D code.
Longer answer: There is an explanation of this warning in the Mono Technical FAQ at https://www.mono-project.com/docs/faq/technical/. Specifically, it means that the internal implementation of some classes is different between Mono and the official MS.NET implementation. This could cause issues if you attempted to serialize an object (e.g. saving an object in a file) in a Mono application, and then tried to read in that object in a .NET application.
From the FAQ:
If you are serializing your own classes, there is no problem, since you have control over the assemblies and classes being used for serialization.
However, if you are serializing objects from the framework, serialization compatibility is not guaranteed, since the internal structure of those objects may be different. This compatibility is not even guaranteed between different MS.NET versions or Mono versions.
...
In summary, if you are designing an application that will run in different environments and platforms which are not under your control, and which need to share serialized objects (either using remoting, plain files, or whatever), you must be careful with what objects you share, and avoid objects from the framework when possible.
So, if you are simply saving and loading objects within your own code in your Mono application or Unity3D application, then you can safely ignore this warning.
Upvotes: 0