We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent de7a1d2 commit 54d089bCopy full SHA for 54d089b
src/runtime/StateSerialization/RuntimeData.cs
@@ -18,11 +18,19 @@ public static class RuntimeData
18
19
public readonly static Func<IFormatter> DefaultFormatterFactory = () =>
20
{
21
- try
+ var fw = RuntimeInformation.FrameworkDescription;
22
+ if (fw.StartsWith(".NET Framework") || fw.StartsWith("Mono"))
23
- return new BinaryFormatter();
24
+ try
25
+ {
26
+ return new BinaryFormatter();
27
+ }
28
+ catch
29
30
+ return new NoopFormatter();
31
32
}
- catch
33
+ else
34
35
return new NoopFormatter();
36
0 commit comments