question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Broken references deserialization

See original GitHub issue

Hi, 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:closed
  • Created 3 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ondrasvobodacommented, Jun 22, 2020

Works great, thanks!

1reaction
ondrasvobodacommented, Jun 22, 2020

Yes, that’s due to removing additional data.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found