dotnet / winforms

Windows Forms is a .NET UI framework for building Windows desktop applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BinaryFormatter error when Copy/Cut/Paste menu item in DemoConsole application

elachlan opened this issue · comments

.NET version

.NET 9.0: Main branch

Did it work in .NET Framework?

Yes

Did it work in any of the earlier releases of .NET Core or .NET 5+?

n/a

Issue description

In DemoConsole test app of Winforms repo, BinaryFormatter error when clicking Copy/Cut/Paste commands for Menu Item.

image

Steps to reproduce

Test sample: DemoConsole in Winforms repo

Related: #6267 / #6269

After PR #11540, the error System.PlatformNotSupportedException: 'BinaryFormatter serialization and deserialization have been removed. appears

Before this PR, executing Copy/Cut/Paste menu item would give a different error, the error was
image

This BinaryFormatter error disappear after add binary Formatter package (Related PR #11741)

We're dependent on BinaryFormatter for CodeDomSerialization and adding the package fixes the issue

Verified the issue on the latest DemoConsole test app of Winforms repo from main branch, it was fixed: no error when Copy/Cut/Paste menu item in DemoConsole application.
GHIssue11617