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

Add back support for deserialization of BinaryFormatted resources - #20907

Merged
stephentoub merged 3 commits into
dotnet:masterfrom
ericstj:resourceReaderBF
Nov 10, 2018
Merged

stephentoub merged 3 commits into
dotnet:masterfrom
ericstj:resourceReaderBF

Conversation

@ericstj

@ericstj ericstj commented Nov 9, 2018

Copy link
Copy Markdown
Member

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.

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.
Changes lazy initialization to use LazyInitializer

Remove special handling of missing serialization assembly.

Clean up comments,

@jkotas jkotas left a comment

Copy link
Copy Markdown
Member

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 stephentoub left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, Eric!

@ericstj

ericstj commented Nov 9, 2018

Copy link
Copy Markdown
Member Author

test CentOS7.1 x64 Checked Innerloop Build and Test

@ericstj

ericstj commented Nov 9, 2018

Copy link
Copy Markdown
Member Author

test OSX10.12 x64 Checked Innerloop Build and Test

@mmitche

mmitche commented Nov 9, 2018

Copy link
Copy Markdown
Member

@dotnet-bot test this please

@ericstj

ericstj commented Nov 10, 2018

Copy link
Copy Markdown
Member Author

Test Windows_NT x64 Checked CoreFx Tests

_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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nit permitDeserialization:false ?

@stephentoub
stephentoub dismissed morganbr’s stale review November 10, 2018 01:54

Concerns addressed

@stephentoub
stephentoub merged commit 791332b into dotnet:master 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.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants