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

[dotnet-sdk-9.0.100-preview.6.24325.8] Bulk-Crap-Uninstaller launch failed with error: Exception type : System.PlatformNotSupportedException Message : BinaryFormatter serialization and deserialization have been removed #11597

Open
Junjun-zhao opened this issue Jun 27, 2024 · 3 comments
Labels
area-Serialization-BinaryFormatter untriaged The team needs to look at this issue in the next triage

Comments

@Junjun-zhao
Copy link
Member

Junjun-zhao commented Jun 27, 2024

.NET version

Dotnet Info:

.NET SDK:
 Version:           9.0.100-preview.6.24325.8
 Commit:            89054b0c37
 Workload version:  9.0.100-manifests.29b7987d
 MSBuild version:   17.11.0-preview-24318-05+4a45d5633

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.22000
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\9.0.100-preview.6.24325.8\

.NET workloads installed:
Configured to use loose manifests when installing new manifests.
There are no installed workloads to display.

Host:
  Version:      9.0.0-preview.6.24321.8
  Architecture: x64
  Commit:       static

.NET SDKs installed:
  9.0.100-preview.6.24325.8 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 9.0.0-preview.6.24324.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 9.0.0-preview.6.24321.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 9.0.0-preview.6.24322.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

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.24314.10: Pass
2). Windows 10 21H2 AMD64 + dotnet-sdk-9.0.100-preview.7.24321.3: Fail
3). Windows 10 21H2 AMD64 + dotnet-sdk-9.0.100-preview.6.24325.8: Fail

Issue description

When run the 3rd party application with the latest .NET 9 build "dotnet-sdk-9.0.100-preview.6.24325.8", it failed to launch with error: System.PlatformNotSupportedException : BinaryFormatter serialization and deserialization have been removed.

Application Name: Bulk-Crap-Uninstaller(WinForms)
OS: Windows 10 21H2
CPU: X64
.NET Build Number: dotnet-sdk-9.0.100-preview.6.24325.8
App or Source Checking at: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2110654

Steps to reproduce

App Repro steps:
1.Set System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization switch to True and set runtime version to .NET 9.0.100-preview.6.24325.8 in BCUninstaller.runtimeconfig.json.

"frameworks": [
      {
        "name": "Microsoft.NETCore.App",
        "version": "9.0.0-preview.6.24321.8"
      },
      {
        "name": "Microsoft.WindowsDesktop.App",
        "version": "9.0.0-preview.6.24322.3"
      }
    ],
"configProperties": {
      "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": true
    }

2.Launching BCUninstaller.exe
3. Click Close button to quit app

Expected Result:
Close successfully.

Actual Result:
App is crashed.
image
BulkCrapUninstaller_BugReproSteps

Exception type : System.PlatformNotSupportedException

Message : BinaryFormatter serialization and deserialization have been removed. See https://aka.ms/binaryformatter for more information.
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph)
   at BrightIdeasSoftware.ObjectListView.SaveState() in D:\Bulk-Crap-Uninstaller\source\ObjectListView\ObjectListView.cs:line 5872
   at BulkCrapUninstaller.Functions.Tools.SettingTools.SaveSettings() in D:\Bulk-Crap-Uninstaller\source\BulkCrapUninstaller\Functions\Tools\SettingTools.cs:line 108
   at BulkCrapUninstaller.Forms.MainWindow.MainWindow_FormClosed(Object sender, FormClosedEventArgs e) in D:\Bulk-Crap-Uninstaller\source\BulkCrapUninstaller\Forms\Windows\MainWindow.cs:line 783
   at BulkCrapUninstaller.Forms.MainWindow.OnFormClosed(FormClosedEventArgs e) in D:\Bulk-Crap-Uninstaller\source\BulkCrapUninstaller\Forms\Windows\MainWindow.cs:line 236
   at System.Windows.Forms.Form.WmClose(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(HWND hWnd, MessageId msg, WPARAM wparam, LPARAM lparam)

Known Workarounds
No.
Tried the following steps:

  1. Turn on the AppContext Switch like <EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
  2. Install the System.Runtime.Serialization.Formatters nuget package (Failed. Because it is not compatible with this .NET 6.0 App. The supported .NET version of System.Runtime.Serialization.Formatters nuget package is .NET 8)

@dotnet-actwx-bot @dotnet/compat

@Junjun-zhao Junjun-zhao added the untriaged The team needs to look at this issue in the next triage label Jun 27, 2024
@elachlan
Copy link
Contributor

Related: #6267

@elachlan
Copy link
Contributor

elachlan commented Jun 27, 2024

Application needs to add <EnableUnsafeBinaryFormatterSerialization>True</EnableUnsafeBinaryFormatterSerialization>.

Project located at: https://github.com/Klocman/Bulk-Crap-Uninstaller

@elachlan
Copy link
Contributor

@Klocman just a ping to let you know this issue was reported here for Bull-Crap-Uninstaller.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Serialization-BinaryFormatter untriaged The team needs to look at this issue in the next triage
Projects
None yet
Development

No branches or pull requests

2 participants