Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider aggressive AppContext switch for enabling safer BinaryFormatedObject usage #8290

Closed
Tracked by #6267
JeremyKuhne opened this issue Nov 28, 2022 · 5 comments
Closed
Tracked by #6267
Labels
area-Serialization-BinaryFormatter-FeatureWork Feature work under the general area of BinaryFormatter related serialization
Milestone

Comments

@JeremyKuhne
Copy link
Member

JeremyKuhne commented Nov 28, 2022

All BinaryFormatter blocks should be behind an AppContext switch. For now this will be an opt-out, when and if the BinaryFormatter gets disabled by the runtime this can be driven by whatever is driving the behavior in the runtime.

Now that we have BinaryFormattedObject, thinking of this in terms of aggressive opt-in of it where we don't support full fidelity. For example, we don't support custom comparers for HashTable.

@JeremyKuhne JeremyKuhne added this to the 8.0 Preview1 milestone Nov 28, 2022
@JeremyKuhne
Copy link
Member Author

As part of this we should bring back #7986 under this switch.

@JeremyKuhne
Copy link
Member Author

I'm presuming that this switch should be something like "WindowsFormsDoNotUseBinaryFormatter" and it should be opt-in. The idea here is that you can say "I don't want my app to try to use the BinaryFormatter, enabled or not". The questions:

  1. Do we want have discreet switches for each type of usage? An overall switch? Both?
  2. Does this even matter in the individual cases? If the specific case would fail in the same way with/without the switch it might be moot.

We'll list each of the cases here before we fully design the solution.

@merriemcgaw merriemcgaw modified the milestones: 8.0 Preview2, .NET 8.0 Feb 22, 2023
@JeremyKuhne JeremyKuhne added the area-Serialization-BinaryFormatter-FeatureWork Feature work under the general area of BinaryFormatter related serialization label May 1, 2023
@merriemcgaw
Copy link
Member

@JeremyKuhne @lonitra do we still need this? Is there anything we need to in our templates for .NET 8

@JeremyKuhne JeremyKuhne modified the milestones: .NET 8.0, .NET 9.0 Jul 27, 2023
@JeremyKuhne JeremyKuhne changed the title Add AppContext switch for enabling BinaryFormatter usages Consider aggressive AppContext switch for enabling safer BinaryFormatedObject usage Jul 27, 2023
@JeremyKuhne
Copy link
Member Author

Thinking has changed on this one. The idea now is to potentially add a switch that forces usage of our "safer" binary formatting code when possible. This still needs quite a bit of thought, and we might not do anything. Moved to 9.0.

@JeremyKuhne
Copy link
Member Author

I don't think there is anything to do here.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Serialization-BinaryFormatter-FeatureWork Feature work under the general area of BinaryFormatter related serialization
Projects
None yet
Development

No branches or pull requests

3 participants