SteveDunn / Vogen

A semi-opinionated library which is a source generator and a code analyser. It Source generates Value Objects
Apache License 2.0
887 stars 46 forks source link

Support IXmlSerializable #690

Closed wahtherewahhere closed 3 weeks ago

wahtherewahhere commented 4 weeks ago

Describe the feature

Can vogen support IXmlSerializable for xml serialization? Thanks.

SteveDunn commented 3 weeks ago

That would be useful, thanks for the feedback @wahtherewahhere .

It looks like if this is implemented, it will only work for reference types: after a few hours of headscratching trying to figure out what why I was getting exceptions, I came across this:

https://github.com/dotnet/runtime/issues/99613

Another issue with this is that ReadXml is designed to mutate something, but Vogen doesn't allow mutation (the _value field is readonly).

SteveDunn commented 3 weeks ago

In 5.0.5 beta 3