You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want the C# code generated from our XSD description (imported into the ModelBuilder) to be either trimmable (already possible?), or not need reflection at all (targetable from NativeAOT)?
My understanding is that a CodeDom is built from the XSD (the ModelBuilder).
So either, the generated classes are:
stripped of the current implementation, which adds a bunch of attributes, such as:
and are instead simply made to inherit from IXmlSerializable (or some other scheme),
and then:
made partial, leaving the implementation or the read and write up to the dev, or
it's possible to completely generate the serialization code itself
I know that we have access to the code and that anything is possible, but I'm looking for guidelines that would perhaps help accelerate the effort, or dissuade me from the undertaking.
Has anyone ever asked for anything similar?
Thanks
The text was updated successfully, but these errors were encountered:
I don't understand the use case completely. The generated classes are intended to be used with XmlSerializer so if that's compatible with native AOT it should work. I don't think the generated classes themselves contain any code that requires reflection. The classes are already partial.
I think what @danielo-unity3d means is an automatic implementation of the IXmlSerializable interface. When the XmlSerializer discovers that a class has implemented this interface the interface code is used rather than reflection based serialization. This can make the serialization and deserialization an order of magnitude faster.
Uh oh!
There was an error while loading. Please reload this page.
We want the C# code generated from our XSD description (imported into the
ModelBuilder
) to be either trimmable (already possible?), or not need reflection at all (targetable from NativeAOT)?My understanding is that a
CodeDom
is built from the XSD (theModelBuilder
).So either, the generated classes are:
IXmlSerializable
(or some other scheme),and then:
partial
, leaving the implementation or the read and write up to the dev, orI know that we have access to the code and that anything is possible, but I'm looking for guidelines that would perhaps help accelerate the effort, or dissuade me from the undertaking.
Has anyone ever asked for anything similar?
Thanks
The text was updated successfully, but these errors were encountered: