mxlSerialiser produces diffrent results in builds and editor

We have noticed that our build produce saves that cannot be parsed by the xmlSerialiser used by the editor. We assume the editor and build are somehow using differed versions of the class. When diffing the saves we see that strings and null lists are handled differently.

Anybody else seen this problem and know a way to get the editor and build XMLSerializer working the same way?

Lets say you have a problem.

So you decide to use XML.

Now you have two problems!

In all seriousness, your post is basically par for the course in XML. It’s like living next to a bee farm and constantly finding angry bees in your house, and they just randomly sting you at all hours of the day or night, like when you’re just taking a shower or cooking breakfast, minding your own business, and ZAP you get stung again by an XML bee.

It’s like XML was intentionally designed to infuriate.

If you’re not married to using XML, I highly recommend using something more forgiving like JSON.

Also, remember this:

Problems with Unity “tiny lite” built-in JSON:

In general I highly suggest staying away from Unity’s JSON “tiny lite” package. It’s really not very capable at all and will silently fail on very common data structures, such as Dictionaries and Hashes and ALL properties.

Instead grab Newtonsoft JSON .NET off the asset store for free, or else install it from the Unity Package Manager (Window → Package Manager).

Also, always be sure to leverage sites like:

https://csharp2json.io

XML aside, seems dangerous to have some modules producing different output for the player and editor. Does anybody know how I can make sure they are using the same versions.