Broken references deserialization
See original GitHub issueHi, after updating to the latest version 3.2.0 I’m unable to deserialize correctly XML created with .EnableReferences() option.
Fragment of my XML file:
<ns1:Lookuptable xmlns:ns32="clr-namespace:MA.App.Model.Dto.Lookuptables;assembly=MA" exs:arguments="ns32:PathogenDto">
<Models>
<Capacity>64</Capacity>
<ns2:Pathogen>
<ScientificName>Phellinus igniarius</ScientificName>
<LocalizedName>Phellinus igniarius</LocalizedName>
<PathogenType exs:member="" exs:identity="1">
<Code>f</Code>
<Description>Fungus</Description>
</PathogenType>
</ns2:Pathogen>
<ns2:Pathogen>
<ScientificName>Pholiota destruens</ScientificName>
<LocalizedName>Pholiota destruens</LocalizedName>
<PathogenType exs:member="" exs:reference="1" />
</ns2:Pathogen>
</ns1:Lookuptable>
<ns1:Lookuptable xmlns:ns36="clr-namespace:MA.App.Model.Dto.Lookuptables;assembly=MA" exs:arguments="ns36:PathogenTypeDto">
<Models>
<ns2:PathogenType exs:reference="1" />
</Models>
</ns1:Lookuptable>
After deserialization I get PathogenType with Code and Description null, instead of “f” and “Fungus”. It works in 3.1.4. I’ve seen some changes regarding references in the last version, so am I missing something or is it a bug?
Thanks!
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
After deserialisation object references seem to be different
Usually deserialization does not take care of 2 objects referencing the same objects. Instead it may create a new object at each reference...
Read more >Broken references for prefabs with SerializeReference fields
Hi everybody. I'm trying to get advantage of the new SerializeReference attribute, but encounter difficulties to make it work with prefabs.
Read more >OWASP Top Ten 2017 | A8:2017-Insecure Deserialization
The impact of deserialization flaws cannot be overstated. These flaws can lead to remote code execution attacks, one of the most serious attacks...
Read more >What happens if we serialize and deserialize two objects ...
Multiple references to a single object are encoded using a reference sharing mechanism so that graphs of objects can be restored to the...
Read more >deserializing list<class object> cause the objects property ...
When some other object's property references the object again, the reference to the already serialized object will be added (another attribute), ...
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
Works great, thanks!
Yes, that’s due to removing additional data.