dotnet / dotnet/runtime

System.PlatformNotSupportedException : BinaryFormatter serialization and deserialization have been removed.

Open
#119,631 2 comments 0 reactions 1 assignee Claimed by @jeffhandley View on GitHub
area-System.Management binaryformatter-migration blocking-clean-ci-optional test-bug
Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Description

```
Discovering: System.Management.Tests (method display = ClassAndMethod, method display options = None)
Discovered: System.Management.Tests (found 10 of 28 test cases)
Starting: System.Management.Tests (parallel test collections = on [2 threads], stop on fail = off)
System.Management.Tests.ManagementObjectTests.Serialize_ManagementException [FAIL]
System.PlatformNotSupportedException : BinaryFormatter serialization and deserialization have been removed. See https://aka.ms/binaryformatter for more information.
Stack Trace:
/_/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryFormatter.Removed.cs(18,0): at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph)
/_/src/libraries/System.Management/tests/System/Management/ManagementObjectTests.cs(118,0): at System.Management.Tests.ManagementObjectTests.Serialize_ManagementException()
at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result)
/_/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs(1168,0): at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
/_/src/coreclr/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.CoreCLR.cs(36,0): at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
/_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs(57,0): at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
```

release/10.0 branch, log: https://helixr1107v0xd1eu3ibi6ka.blob.core.windows.net/dotnet-runtime-refs-pull-119521-merge-62a904c1b27d4ac6b4/System.Management.Tests/1/console.64e89dbb.log?skoid=8eda00af-b5ec-4be9-b69b-0919a2338892&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2025-09-12T08%3A40%3A46Z&ske=2025-09-12T09%3A40%3A46Z&sks=b&skv=2024-11-04&sv=2024-11-04&st=2025-09-12T08%3A40%3A46Z&se=2025-09-12T09%3A40%3A46Z&sr=c&sp=r&sig=oYt%2B22iKNslhX9cY%2B5n165xvAJGP6qq3a5WguEf76bw%3D

Seems like Windows only problem.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.