Skip to content

Change Microsoft.XmlSerializer.Generator to not use private reflection on XElement constructor #37970

Description

@eerhardt

See the discussion in #35725, specifically this comment: #35725 (comment).

We should change the C# generation to special case XElement (just like we did for the IL generation case), and have it generate new XElement("default") instead of calling Activator.CreateInstance. Using private reflection can easily be broken in the future, so we shouldn't rely on it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions