Comments (13)
Branch issues/fix/i609 created!
from home.
Hey there @RashmiBK5 thank you for writing in and for reporting this. There should not be any breaking changes for minor versions so this appears to be a bug. I will look into this for you and see what happened. 👍
from home.
Alright I spent some time looking into this for you @RashmiBK5 and please do pardon my confusion as I didn't realize when 3.2.x was released as it was back in 2020. To be honest I am not sure how well I will be able to support you here.
Nonetheless I did try to load your code with these versions, but there does not appear to be neither an IXmlConfiguration<T>
nor an IConfigurationContainer.Configure
that supports it.
If you are able to provide code that better illustrates the issue I can try seeing what I can do here.
from home.
I have updated the code, could you please check.
But in sample application base configuration is never considered in 3.2.3.
from home.
Thank you @RashmiBK5. I appreciate you creating a project. If you are further able to post it as a repository I would greatly appreciate it. I am not a fan of zips as they are a security consideration.
from home.
code is available in
https://github.com/RashmiBK5/ExtendedXML
Contribute to RashmiBK5/ExtendedXML development by creating an account on GitHub.
from home.
Thank you very much for that @RashmiBK5 and for your understanding. 🙏 Looking into this now for you.
from home.
Alright @RashmiBK5 I see that IXmlConfiguration is a custom class but I unfortunately fail to see how you are configuring it. I tried using the code you initially reported, but it results in errors:
Can you update the repository with the code you opened the ticket with?
from home.
I have updated the Code, now you should be able to run the code https://github.com/RashmiBK5/ExtendedXML
version 3.2.3
<? xml version = "1.0" encoding = "utf-8" ?>
< Details xmlns = "clr-namespace:;assembly=ConsoleApp1" >
< Description > test </ Description >
< Objects xmlns: sys = "https://extendedxmlserializer.github.io/system" xmlns: exs = "https://extendedxmlserializer.github.io/v2" exs: type = "sys:List[BaseClass]" >
< Capacity > 4 </ Capacity >
< DerivedClass >
< IsSelected > false </ IsSelected >
< Property2 > Property2 </ Property2 >
</ DerivedClass >
< DerivedClass2 >
< IsSelected > false </ IsSelected >
< Property3 > Property3 </ Property3 >
</ DerivedClass2 >
</ Objects >
</ Details >
version 3.2.4 onwards
<? xml version = "1.0" encoding = "utf-8" ?>
< Details xmlns = "clr-namespace:;assembly=ConsoleApp1" >
< Description > test </ Description >
< Objects xmlns: sys = "https://extendedxmlserializer.github.io/system" xmlns: exs = "https://extendedxmlserializer.github.io/v2" exs: type = "sys:List[BaseClass]" >
< Capacity > 4 </ Capacity >
< DerivedClass >
< Property1 > BaseDerivedClass1 </ Property1 >
< IsSelected > false </ IsSelected >
< Property2 > Property2 </ Property2 >
</ DerivedClass >
< DerivedClass2 >
< Property1 > BaseDerivedClass2 </ Property1 >
< IsSelected > false </ IsSelected >
< Property3 > Property3 </ Property3 >
</ DerivedClass2 >
</ Objects >
</ Details >
from home.
Thank you very much for your provided information @RashmiBK5. I have isolated this to #416 and while all the tests passed at the time, you're right here I should have put more thought into the change as technically it is breaking. What we need is some way of assigning the preferred member comparer, or maybe some other fix for this. I'll continue to think about it.
from home.
Hi @RashmiBK5 unfortunately I have not been able to figure out a good solution for you, or at least one that I can incorporate into the codebase as a PR after a few hours of investigation. I've tried a few approaches but all of them result in broken tests.
The class in question that is causing this issue is MemberComparer
:
I have several suggestions:
- Repeat the member configurations on all types (yuck, I know)
- Attempt to create a PR with a fix in
MemberComparer
above that addresses your issues and passes all existing tests. - Fork this repository and use a special build of ExtendedXmlSerializer, using the code below to replace MemberComparer. This worked for all tests except for one, which I was not able to dertermine why in the time I spent in it:
using System.Reflection;
namespace ExtendedXmlSerializer.ReflectionModel
{
sealed class MemberComparer : IMemberComparer
{
public static MemberComparer Default { get; } = new MemberComparer();
MemberComparer() : this(Defaults.TypeComparer) {}
readonly ITypeComparer _type;
public MemberComparer(ITypeComparer type) => _type = type;
public bool Equals(MemberInfo x, MemberInfo y)
=> x.Name.Equals(y.Name) &&
(_type.Equals(x.ReflectedType.GetTypeInfo(), y.ReflectedType.GetTypeInfo()) ||
x.ReflectedType.IsAssignableFrom(y.DeclaringType));
public int GetHashCode(MemberInfo obj) => 0;
}
}
I wish I could assist more but unfortunately my time is limited these days. Please see #383 for more information. Please let me know of any further questions you may have and I will further assist you.
from home.
Thanks a lot @Mike-E-angelo
What should I do to get the fix as part of Nuget package. I want the fix to be added to version 3.7.6.
And will the same fix be added to latest version as well? in future when we Upgrade to latest version, I will face same issue.
from home.
Hi @RashmiBK5 thank you for your continued collaboration. Getting this into the official package is the tricky part, as when I attempted to do so I could not get all tests to pass.
So the idea here is to submit a Pull Request that fixes this issue while ensuring all tests as written pass. I would then review it and if it looks OK, accept it and create a new NuGet package from there.
If this is something you are interested in participating in, I can help/support you through the process.
Please note that this might take some time as it has been a while since the last release and there are some considerations to account for, one of which is to generate a new publishing key on NuGet as the last one expired.
from home.
Related Issues (20)
- Remove netcoreapp3.1 HOT 2
- Update build keys HOT 2
- Update Documentation Key HOT 2
- Circular dependencies detection problem 2 HOT 8
- Address Warnings HOT 1
- (De)serialization of objects with property-name same as object-name stopped working correctly since V3.2 HOT 11
- Target Instances Remain In Activation HOT 1
- Address Warnings HOT 1
- Dictionary/List serialization issue/question HOT 6
- Sprache.ParseException? HOT 4
- ShouldSerialize is not working. HOT 2
- DateOnly type not serialized HOT 8
- Deserialization of inherited class with different namespaces not possible with Migration HOT 8
- Deserialization issue with inherited class with different namespaces and Migration HOT 2
- Update NuGet Key HOT 1
- Update GitHub API Token HOT 1
- API Key HOT 1
- Update Deploy Key HOT 2
- Update Script for RSA HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from home.