Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/runtime/StateSerialization/RuntimeData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,19 @@ public static class RuntimeData

public readonly static Func<IFormatter> DefaultFormatterFactory = () =>
{
try
var fw = RuntimeInformation.FrameworkDescription;
if (fw.StartsWith(".NET Framework") || fw.StartsWith("Mono"))
{
return new BinaryFormatter();
try
{
return new BinaryFormatter();
}
catch
{
return new NoopFormatter();
}
}
catch
else
{
return new NoopFormatter();
}
Expand Down
Loading