public class TestClass
{
public IList<Uri> Urls { get; } = new List<Uri>();
}
Throws an AmbiguousComparerOverrideResolutionException when compared with this code:
public void CompareTestClass()
{
var obj1 = new TestClass();
obj1.Urls.Add(new Uri("https://Test.com"));
var obj2 = new TestClass();
obj2.Urls.Add(new Uri("https://Test.com"));
var comparer = new ObjectsComparer.Comparer<TestClass>();
// comparer.AddComparerOverride<IList<Uri>>(new ListOfUriComparer());
IEnumerable<Difference> differences = new List<Difference>();
comparer.Compare(obj1, obj2, out differences);
}
Uncommenting the line with the AddComparerOverride method solves the issue but the comparer should be able to compare list of Uri natively.
Also, the error message is misleading:
Unable to resolve comparer for type System.Uri. More than one value comparer meet criteria for this type.
A class like this:
Throws an AmbiguousComparerOverrideResolutionException when compared with this code:
Uncommenting the line with the AddComparerOverride method solves the issue but the comparer should be able to compare list of Uri natively. Also, the error message is misleading:
It should reference IList of Uri. Thanks.