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.
2 parents b7d0e53 + 54d089b commit 38c87d9Copy full SHA for 38c87d9
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