Serialization Problem
See original GitHub issueHi,
I want to deserialize a xml file into a class (Scene.cs) containing this variable:
public List<GameObject> SceneGraph { get; set; }
This is the GameObject class: I’m trying to serialize this class:
https://github.com/michidk/BrokenEngine/blob/master/BrokenEngine/GameObject.cs
My xml file currently looks like this:
<?xml version="1.0"?>
<Scene xmlns="BrokenEngine.Scene">
<SceneGraph>
<GameObject type="BrokenEngine.GameObject">
<Name>Super Cool GameObject</Name>
<Position type="OpenTK.Vector3">
<X>1</X>
<Y>1</Y>
<Z>1</Z>
</Position>
</GameObject>
</SceneGraph>
</Scene>
I’ve already added a public, parameterless constructor. I get the following error: {“Value cannot be null.\r\nParameter name: method”} What do I do wrong?
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (7 by maintainers)
Top Results From Across the Web
Serialization/deserialization problems
If you face a serialization/deserialization error, it is likely that you need to provide a custom serializer/deserializer. Here is one of the known...
Read more >c# - Serialization problem
Now, the problem appears when from Project A I try to serialize the objects from B. An exception is thrown that says a...
Read more >Serialize and Deserialize Binary Tree
Can you solve this real interview question? Serialize and Deserialize Binary Tree - Serialization is the process of converting a data structure or...
Read more >Serialization
Serializing the data structure in an architecture-independent format means preventing the problems of byte ordering, memory layout, or simply different ways ...
Read more >Why We Hate Java Serialization And What We're Doing About ...
Java Serialization is well known to be one of the worst features of ... The problem is that, while most of the industry...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Correct, @michidk. In fact I believe at the moment if you place an
XmlElementAttribute
on the privatechildren
field it will pick it up as a member to emit. Since it is aList<>
, it will satisfy the Collection condition above and emit accordingly.Great job so far!
It would be no problem for me to change GameObject so that it implements ICollection. Would this make this class de-/serializeable? If so, this is great and all I need.