SerializationException Field not found
I have a class "PlayerData" that includes a few variables, all public, that is marked Serializable. However, upon deserialization of a List, Unity is throwing the error "SerializationException: Field "ip" not found in class PlayerData." I'm not certain what is causing this, but I will mention that the serialized state is created by a Windows Forms app (it's compiled in Unity .Net 3.5) and the deserialization is being done in a Unity script. Any solutions for this?
[Serializable()] public class PlayerData { public string Identity = ""; public bool InGame = false; public string ip; public int port; }
Answer by Bertlapp · Jul 23, 2018 at 12:13 AM
Not sure this is applicable on your class but I had a similar problem and solved it by removing the auto implement get and set for my variables!
Your answer
![](https://koobas.hobune.stream/wayback/20220612131946im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Cannot read past end of stream, MemoryStream 1 Answer
Deserialize an outside object in Unity 0 Answers
Null Exception while serialize json string into txt file 0 Answers
How Can I deserialize List type data from a Binary file? 0 Answers
My singleton is getting reinitialized when I change scene 1 Answer