Circular dependencies detection problem 2
See original GitHub issueContinuation of https://github.com/ExtendedXmlSerializer/home/issues/583
I have new case of same problem Looks like this problem have more shades. Problem found unexpectedly, previously we use .EnableReferences() but soon as we switched to .AllowMultipleReferences() new problem is occured. If I EnableReferences for same object it will serialize successfully, but will never use exs:reference="1"exs:identity=“1” I suppose this object should serialize with .AllowMultipleReferences only Even Array.Empty<string> will be detected as MultipleReferences
using ExtendedXmlSerializer;
using ExtendedXmlSerializer.Configuration;
var sameInnerObject = new InnerObject { Id = 100, Items = new string[] { } };
var testRootObject = new RootObject
{
Item1 = sameInnerObject,
Item2 = new InnerObject2 { Items = sameInnerObject.Items },
List = new List<InnerObject>()
};
IExtendedXmlSerializer serializer = new ConfigurationContainer()
.AllowMultipleReferences()
//.EnableReferences()
.Create();
var serialized = serializer.Serialize(testRootObject);
Console.WriteLine("Success");
public class RootObject
{
public InnerObject Item1 { get; set; }
public InnerObject2 Item2 { get; set; }
public List<InnerObject> List { get; set; } = new();
}
public class InnerObject
{
public int Id { get; set; }
public string[] Items { get; set; }
}
public class InnerObject2
{
public string[] Items { get; set; }
}
Issue Analytics
- State:
- Created 8 months ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
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 >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
Detecting circular dependencies can be challenging, especially in larger codebases. Here are some common signs to look out for: Error messages ...
Read more >Circular Dependencies in Spring
A circular dependency occurs when a bean A depends on another bean B, and the bean B depends on bean A as well:...
Read more >Circular dependencies detection do not exclude tests in ...
I write a test for the first library, in this test, I import the second library and the tests works properly but if...
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 Free
Top 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
@Mike-E-angelo Look like it helps on my side. Currently it is not generating Exceptions. Thanks. Please push it into nuget😎
Oh I see… are you saying this is throwing a
CircularReferencesDetectedException
instead of aMultipleReferencesDetectedException
? I can look into that if so. 👍