This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Add back support for deserialization of BinaryFormatted resources #20907
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This adds back support for using BinaryFormatter to deserialize resources when loaded from assembly. We conditionally load BinaryFormatter and will throw if asked to deserialize binary formatted resources and cannot find it.
ericstj
requested review from
GrabYourPitchforks,
stephentoub,
ViktorHofer and
tarekgh
November 9, 2018 08:07
jkotas
reviewed
Nov 9, 2018
src/System.Private.CoreLib/shared/System/Resources/ResourceReader.cs
Outdated
Show resolved
Hide resolved
jkotas
reviewed
Nov 9, 2018
src/System.Private.CoreLib/shared/System/Resources/ResourceReader.cs
Outdated
Show resolved
Hide resolved
jkotas
reviewed
Nov 9, 2018
stephentoub
reviewed
Nov 9, 2018
stephentoub
reviewed
Nov 9, 2018
src/System.Private.CoreLib/shared/System/Resources/ResourceReader.cs
Outdated
Show resolved
Hide resolved
stephentoub
reviewed
Nov 9, 2018
src/System.Private.CoreLib/shared/System/Resources/ResourceReader.cs
Outdated
Show resolved
Hide resolved
ViktorHofer
reviewed
Nov 9, 2018
src/System.Private.CoreLib/shared/System/Resources/ResourceReader.cs
Outdated
Show resolved
Hide resolved
Changes lazy initialization to use LazyInitializer Remove special handling of missing serialization assembly. Clean up comments,
ericstj
force-pushed
the
resourceReaderBF
branch
from
November 9, 2018 17:08
9a61975
to
d13f26a
Compare
jkotas
reviewed
Nov 9, 2018
src/System.Private.CoreLib/src/System/Resources/ManifestBasedResourceGroveler.cs
Outdated
Show resolved
Hide resolved
jkotas
approved these changes
Nov 9, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for getting this unblocked!
stephentoub
reviewed
Nov 9, 2018
src/System.Private.CoreLib/src/System/Resources/ManifestBasedResourceGroveler.cs
Outdated
Show resolved
Hide resolved
stephentoub
approved these changes
Nov 9, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Eric!
test CentOS7.1 x64 Checked Innerloop Build and Test |
test OSX10.12 x64 Checked Innerloop Build and Test |
ViktorHofer
approved these changes
Nov 9, 2018
@dotnet-bot test this please |
morganbr
previously requested changes
Nov 9, 2018
src/System.Private.CoreLib/src/System/Resources/ManifestBasedResourceGroveler.cs
Show resolved
Hide resolved
Test Windows_NT x64 Checked CoreFx Tests |
danmoseley
reviewed
Nov 10, 2018
@@ -195,14 +195,14 @@ internal RuntimeResourceSet(string fileName) : base(false) | |||
{ | |||
_resCache = new Dictionary<string, ResourceLocator>(FastResourceComparer.Default); | |||
Stream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); | |||
_defaultReader = new ResourceReader(stream, _resCache); | |||
_defaultReader = new ResourceReader(stream, _resCache, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit permitDeserialization:false
?
danmoseley
approved these changes
Nov 10, 2018
picenka21
pushed a commit
to picenka21/runtime
that referenced
this pull request
Feb 18, 2022
…tnet/coreclr#20907) * Add back support for deserialization of BinaryFormatted resources This adds back support for using BinaryFormatter to deserialize resources when loaded from assembly. We conditionally load BinaryFormatter and will throw if asked to deserialize binary formatted resources and cannot find it. * Apply code-review feedback Changes lazy initialization to use LazyInitializer Remove special handling of missing serialization assembly. Clean up comments, * Use named parameter when specifying permitDeserialization Commit migrated from dotnet/coreclr@791332b
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds back support for using BinaryFormatter to deserialize resources when loaded
from assembly.
We conditionally load BinaryFormatter and will throw if asked to deserialize binary formatted
resources and cannot find it.
I'll put up a CoreFx PR shortly with tests.