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.

Circular dependencies detection problem

See original GitHub issue

I got exception about circular dependencies, but there are no circular dependencies just same property types and same object. Just show code instead of 1000 words

using ExtendedXmlSerializer;
using ExtendedXmlSerializer.Configuration;

var sameInnerObject = new InnerObject { Id = 100 };
var testRootObject = new RootObject
{
    Item1 = sameInnerObject,
    Item2 = null,
    List = new List<InnerObject>
    {
        sameInnerObject
    }
};

var serialized = new ConfigurationContainer().Create().Serialize(testRootObject);
Console.WriteLine("Success");

public class RootObject
{
    // This is the same object type as Item2 but can have other value
    public InnerObject? Item1 { get; set; }
    
    // This is the same object type as Item1 but can have other value
    public InnerObject? Item2 { get; set; }
    
    //Should have the same object as Item1 or Item2
    public List<InnerObject> List { get; set; } = new();
}

public class InnerObject
{
    public int Id { get; set; }
}

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Mike-E-angelocommented, Dec 27, 2022

Alright @UladimirLameyko you should be able to get the latest NuGet with this change here: https://www.nuget.org/packages/ExtendedXmlSerializer

Thank you for improving ExtendedXmlSerializer. Happy Holidays out there 🎄⛄🌟

<div>ExtendedXmlSerializer 3.7.9</div><div>An extensible Xml Serializer for .NET that builds on the functionality of the classic XmlSerializer with a powerful and robust extension model.</div>
1reaction
UladimirLameykocommented, Dec 27, 2022

It is actually incredible to see your fix so fast. Thank you very much. 😎 Will you create a new release with that fix?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I detect circular logic or recursion in a multi-levels ...
One way to detect circular dependency is to keep a record of the length of the dependency chains that your ordering algorithm detects....
Read more >
My Experience with Circular Dependencies in JavaScript
How to Detect Circular Dependencies? · Error messages or warnings that mention circular dependencies · Unexpected behaviour or results that ...
Read more >
How to fix nasty circular dependency issues once and for ...
Fix attempt 1. So, it turns out that our circular dependency causes a nasty problem. However, if we look closely it is pretty...
Read more >
Circular dependency
In software engineering, a circular dependency is a relation between two or more modules which either directly or indirectly depend on each other...
Read more >
Google Sheets Circular Dependency Detected Error [Easy ...
As the name suggests, circular dependency creates a loop where variables are dependent on each other. Fixing this error relies on breaking the...
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