- Home /
Serialization errors..
Hello!
We use JSON to serialize things to disk. But now we have started to get exceptions when deserializing the data.
The exception is...weird:
System.MissingMethodException: Method not found: 'Default constructor not found...ctor() of System.ComponentModel.Int32Converter'.
at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x00000] in <filename unknown>:0
at System.Activator.CreateInstance (System.Type type) [0x00000] in <filename unknown>:0
at System.ComponentModel.TypeDescriptor.GetConverter (System.Type type) [0x00000] in <filename unknown>:0
at JsonFx.Json.TypeCoercionUtility.CoerceType (System.Type targetType, System.Object value) [0x00000] in <filename unknown>:0
at JsonFx.Json.JsonReader.ReadNumber (System.Type expectedType) [0x00000] in <filename unknown>:0
at JsonFx.Json.JsonReader.Read (System.Type expectedType, Boolean typeIsHint) [0x00000] in <filename unknown>:0
at JsonFx.Json.JsonReader.ReadObject (System.Type objectType) [0x00000] in <filename unknown>:0
at JsonFx.Json.JsonReader.Read (System.Type expectedType, Boolean typeIsHint) [0x00000] in <filename unknown>:0
at JsonFx.Json.JsonReader.Deserialize (Int32 start, System.Type type) [0x00000] in <filename unknown>:0
at JsonFx.Json.JsonReader.Deserialize (System.String value, Int32 start, System.Type type) [0x00000] in <filename unknown>:0
at JsonFx.Json.JsonReader.Deserialize[CurrencyManager] (System.String value) [0x00000] in <filename unknown>:0
So...all of a sudden, JSON can not convert ints..?
Thx in advance! (btw.. not a problem in the editor, just on the iPhone)
Edit: Our "CurrencyManager" is just a class with 2 int:s in it.
Try changing the .net version in the build settings if it is set to the subset of 2.0, change it to .net 2.0, something to try at least.
Switching to the 2.0 (not the 2.0 Subset) makes the game hang during startup. No idea why... Seems to only be able to choose: 2.0 Subset and Strip Bytecode. If anything else, the game hangs/crashes during startup.
2.0. So that might be the problem. But I have seen a lot of posts about 3rd party serilization-libs not working. Or..strings work but nothing else.
I have switched to Xml and that seems to work. JSON would have been..nice. $$anonymous$$uch more readable if/when needed.
Thx anyhow!