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

Add back support for deserialization of BinaryFormatted resources #20907

Merged
merged 3 commits into from
Nov 10, 2018

Conversation

ericstj
Copy link
Member

@ericstj ericstj commented Nov 9, 2018

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,
Copy link
Member

@jkotas jkotas left a 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!

Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

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

Thanks, Eric!

@ericstj
Copy link
Member Author

ericstj commented Nov 9, 2018

test CentOS7.1 x64 Checked Innerloop Build and Test

@ericstj
Copy link
Member Author

ericstj commented Nov 9, 2018

test OSX10.12 x64 Checked Innerloop Build and Test

@mmitche
Copy link
Member

mmitche commented Nov 9, 2018

@dotnet-bot test this please

@ericstj
Copy link
Member Author

ericstj commented Nov 10, 2018

Test Windows_NT x64 Checked CoreFx Tests

@@ -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);
Copy link
Member

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