Skip to content

Conversation

@ericstj
Copy link
Member

@ericstj ericstj commented Jul 18, 2024

Fixes: #104914, #29429

As mentioned in the issue, this problem was introduced in net6.0 when EnableUnsafeBinaryFormatterInPropertyValueSerialization check was added.

Previously this would not even hit BinaryFormatter, it would thow when casting to byte[] and that would be caught and execution would continue.

With the change in 6.0 it began throwing when EnableUnsafeBinaryFormatterInPropertyValueSerialization was not set. To avoid this, we'll test first if we could even use BinaryFormatter before consulting the flag to throw.

This also fixes #29429 which was caused by contention for user.config between the tests in LocalFileSettingsProviderTests.

@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-configuration
See info in area-owners.md if you want to be subscribed.

@ericstj ericstj added the binaryformatter-migration Issues related to the removal of BinaryFormatter and migrations away from it label Jul 18, 2024
Copy link
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

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

LGTM, thank you @ericstj !

@ericstj ericstj merged commit 7cdd2e9 into dotnet:main Jul 18, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Aug 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Configuration binaryformatter-migration Issues related to the removal of BinaryFormatter and migrations away from it

Projects

None yet

3 participants