Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Handle binary formatted payloads with ResX mangled generic type names #42102

Merged
merged 2 commits into from
Oct 29, 2019

Conversation

ericstj
Copy link
Member

@ericstj ericstj commented Oct 25, 2019

ResXSerializationBinder on desktop corrupted type names for generic parameters
in the binary formatted payload. It would also undo this in the reader,
but we don't benefit from that in .NETCore since we don't deserialize
during build: we just copy the preserialized payload into the resources.

To handle this, we use a serialization binder to un-mangle the type names
in a way similar to ResXSerializationBinder. We do it slightly differently
so that we only do it when needed, since relying on the binder to resolve
the type bypasses the type cache in BinaryFormatter.

ResXSerializationBinder on desktop corrupted type names for generic parameters
in the binary formatted payload.  It would also undo this in the reader,
but we don't benefit from that in .NETCore since we don't deserialize
during build: we just copy the preserialized payload into the resources.

To handle this, we use a serialization binder to un-mangle the type names
in a way similar to ResXSerializationBinder.  We do it slightly differently
so that we only do it when needed, since relying on the binder to resolve
the type bypasses the type cache in BinaryFormatter.
Copy link
Member

@rainersigwald rainersigwald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good to me. I notice you're targeting master; what is the ship vehicle for this? It would also be needed for the desktop-application-using-S.R.Exts-built-with-Core scenario, right?

@ericstj
Copy link
Member Author

ericstj commented Oct 25, 2019

I notice you're targeting master

All our changes go into master first and we cherry-pick to release. I plan to bring this up in 3.1 ask mode.

@ericstj
Copy link
Member Author

ericstj commented Oct 29, 2019

Tested this by patching both MSBuild and WindowsDesktop shared framework with the fix and it addressed the issue.

@ericstj ericstj merged commit feebf02 into dotnet:master Oct 29, 2019
ericstj added a commit to ericstj/corefx that referenced this pull request Oct 29, 2019
…dotnet#42102)

* Handle binary formatted payloads with ResX mangled generic type names

ResXSerializationBinder on desktop corrupted type names for generic parameters
in the binary formatted payload.  It would also undo this in the reader,
but we don't benefit from that in .NETCore since we don't deserialize
during build: we just copy the preserialized payload into the resources.

To handle this, we use a serialization binder to un-mangle the type names
in a way similar to ResXSerializationBinder.  We do it slightly differently
so that we only do it when needed, since relying on the binder to resolve
the type bypasses the type cache in BinaryFormatter.

* Respond to feedback.

release/3.1 - regenerate TestData.resources
ericstj added a commit that referenced this pull request Oct 30, 2019
…#42102) (#42209)

* Handle binary formatted payloads with ResX mangled generic type names

ResXSerializationBinder on desktop corrupted type names for generic parameters
in the binary formatted payload.  It would also undo this in the reader,
but we don't benefit from that in .NETCore since we don't deserialize
during build: we just copy the preserialized payload into the resources.

To handle this, we use a serialization binder to un-mangle the type names
in a way similar to ResXSerializationBinder.  We do it slightly differently
so that we only do it when needed, since relying on the binder to resolve
the type bypasses the type cache in BinaryFormatter.

* Respond to feedback.

release/3.1 - regenerate TestData.resources
@karelz karelz added this to the 5.0 milestone Dec 19, 2019
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…dotnet/corefx#42102)

* Handle binary formatted payloads with ResX mangled generic type names

ResXSerializationBinder on desktop corrupted type names for generic parameters
in the binary formatted payload.  It would also undo this in the reader,
but we don't benefit from that in .NETCore since we don't deserialize
during build: we just copy the preserialized payload into the resources.

To handle this, we use a serialization binder to un-mangle the type names
in a way similar to ResXSerializationBinder.  We do it slightly differently
so that we only do it when needed, since relying on the binder to resolve
the type bypasses the type cache in BinaryFormatter.

* Respond to feedback.


Commit migrated from dotnet/corefx@feebf02
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.

5 participants