Skip to content

Conversation

@elinor-fung
Copy link
Member

@elinor-fung elinor-fung commented Jun 26, 2025

Reverts #33004

This was a workaround for #32969 which was fixed in 8.0 (at least the BinaryFormatter portion). The workaround was intended to be removed once that underlying issue was fixed.

Downloaded 8.0.0, checked the framework runtimeconfigs, and verified that running WinForms app without BinaryFormatter explicitly enabled in its runtime config works with 8.0.

cc @GrabYourPitchforks

Copilot AI review requested due to automatic review settings June 26, 2025 02:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR reverts a previous workaround that explicitly enabled EnableUnsafeBinaryFormatterSerialization for WinForms and WPF projects once the underlying runtime issue was fixed in .NET 8.0.

  • Removed the override that defaulted EnableUnsafeBinaryFormatterSerialization to true for projects requiring BinaryFormatter.
  • Relies on .NET 8.0 runtime’s built-in handling instead of the workaround.
Comments suppressed due to low confidence (1)

src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets:196

  • This revert removes the explicit enabling of BinaryFormatter for project types requiring it, but there are no tests verifying the default behavior before and after .NET 8.0. Consider adding or updating unit tests to cover scenarios for TargetFrameworkVersion <8.0 and >=8.0 to ensure the EnableUnsafeBinaryFormatterSerialization property behaves as expected.
    <!-- controls runtime behavior (AppContext & trimming) -->

@elinor-fung elinor-fung changed the title Revert "[port to main] Explicitly enable BF for WinForms and WPF in Microsoft.NET.Sdk.targets" Revert "Explicitly enable BF for WinForms and WPF in Microsoft.NET.Sdk.targets" Jun 26, 2025
@elinor-fung elinor-fung requested a review from a team June 30, 2025 18:52
@elinor-fung elinor-fung merged commit 2ed2664 into main Jul 2, 2025
28 checks passed
@elinor-fung elinor-fung deleted the revert-33004-port_32952 branch July 2, 2025 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants