Skip to content

Conversation

@StephenMolloy
Copy link
Member

Use scopes to resolve array naming issue.

When generating IL code for serializing arrays, we use a
type-based but namespace agnostic naming scheme for
variables in the IL emitted. This can cause naming collisions
for arrays with similar type names that only differ in
namespace. An easy fix is to serialize each array in it's own
scope, so variable names won't conflict with other serialized
members.

Fixes #46196

@StephenMolloy StephenMolloy requested review from HongGit and mconnew July 10, 2021 06:35
@ghost ghost added the area-Serialization label Jul 10, 2021
@StephenMolloy StephenMolloy merged commit 1749deb into dotnet:main Jul 13, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Aug 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

XmlSerializer constructor fails if type has array properties with same class name but different namespaces

3 participants