-
Notifications
You must be signed in to change notification settings - Fork 992
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
[dotnet-sdk-9.0.100-preview.6.24325.8] paintdotnet get System.NotSupportedException: BinaryFormatter serialization and deserialization have been removed #11596
Comments
If people have to instal the NuGet package to get basic WinForms existing apps to work why is it being removed? And if the NuGet package is safe why isn’t it in the product? Will this requirement, break existing deployed applications? For many of us, this entire issue is very confusing. The only use of binary formatter in any application I work in is to decode stuff in form.designer that was written by WinForm designer. Wouldn’t it be better to do a 1 time upgrade of designer file and for the vast majority of applications not use problematic format? If this isn’t place to address this issue please let me know where is. |
@rickbrew just a heads up. I imagine you are probably very much aware. |
@elachlan Yup I’ve been paying close attention to this. PDN uses BF for various things, and I’ll be dealing with it soon-ish, possibly deferring the upgrade to .NET 9/10 for a bit while I’m working on it. |
Because BF is a security black hole. It’s not safe. Also, Paint.NET is not a basic WinForms app, and uses BF in situations where it isn’t usually used. It isn’t representative of the larger ecosystem in other words.
It’s not safe. It’s a compromise. To use BF going forward you essentially have to “sign the consent form” declaring that you understand the risks of using BF and are taking responsibility for it going forward.
This will only be an issue when migrating to .NET 9+. Existing app deployments shouldn’t be affected. |
@rickbrew @elachlan maybe I am misunderstanding. If my app only uses the WinForms form designer and the Resx files it creates when I upgrade to .Net 9.0 will something happen to those files that will remove the need to use BF and avoid this security black hole. The little I have played with .Net 9 for my applications seems to require I add below to project file.
|
@paul1956 You'll want to refer to the other issues etc. that discuss this, e.g. #6267 (comment) . IIUC it's something @JeremyKuhne et. al. are actively working on.
|
Verify this issue for the workaround with the public System.Runtime.Serialization.Formatters Nuget package. It works. Hence closing this issue. |
.NET version
Dotnet Info:
Did it work in .NET Framework?
Not tested/verified
Did it work in any of the earlier releases of .NET Core or .NET 5+?
Yes
Verify Scenarios:
1). Windows 10 21H2 AMD64 + dotnet-sdk-9.0.100-preview.6.24317.13: Pass
2). Windows 10 21H2 AMD64 + dotnet-sdk-9.0.100-preview.6.24325.8: Fail
3). Windows 10 21H2 AMD64 + dotnet-sdk-9.0.100-preview.7.24321.3: Fail
Issue description
When run the 3rd party application with the latest .NET 9 build "dotnet-sdk-9.0.100-preview.6.24325.8", application operate failed with "System.NotSupportedException: BinaryFormatter serialization and deserialization have been removed. See https://aka.ms/binaryformatter for more information.".
Application Name: paint.netcore (WinForms/WPF, .NET 8)
OS: Windows 10 21H2
CPU: X64
.NET Build Number: dotnet-sdk-9.0.100-preview.6.24325.8
App or App Source checking at: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2110612
Steps to reproduce
1.Change the runtime.config file to let the app run against with dotnet-sdk-9.0.100-preview.6.24325.8 and Enable BinaryFormatter.
Expected Result:
Application doesn't crash and work as normal.
Actual Result:
Application crashed.
Exception details (full log file attached):
Known Workaround:
Yes.
It works with following steps. File this issue to track, we want to keep this issue active until we get and verify with the public System.Runtime.Serialization.Formatters nuget package.
@dotnet-actwx-bot @dotnet/compat
The text was updated successfully, but these errors were encountered: