dotnet / announcements

Subscribe to this repo to be notified of Announcements and changes in .NET Core.
Creative Commons Attribution 4.0 International
1.27k stars 44 forks source link

.NET 8 reaches next step in deprecation of `BinaryFormatter` #284

Open terrajobst opened 9 months ago

terrajobst commented 9 months ago

Starting with .NET 8, BinaryFormatter throws NotSupportedException across nearly all project types, including console applications (except Windows Forms and WPF). This run-time change is the next stage of the BinaryFormatter obsoletion plan, in which BinaryFormatter will eventually be removed from .NET.

[!NOTE] Should you need to continue using BinaryFormatter, you can set a compatibility switch in your project file to re-enable BinaryFormatter functionality. See the .NET 8 breaking change notification for more details.

[!NOTE] Please note that there is no change planned for .NET Framework.

The reason is that BinaryFormatter has many security considerations, which makes the API inherently prone to security issues.