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

Skip to content
Closed
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ public BinaryFormatter(ISurrogateSelector selector, StreamingContext context)
this.context=context;
}


// Deserializing objects of type Dictionary<,> List<> and friends does not work in a CoreCLR sandbox, because
// the default deserialization code uses reflection to do its job, and the fields being reflected on live in mscorlib.dll.
// DefaultSurrogateSelector enables embedders to provide an alternative method of deserializing specific types in a way
// that does not violate the CoreCLR rules. See https://gist.github.com/878267 for some actual code that provides CoreCLR safe
// deserialization code for List<> and Dictionary<,>.
// DefaultSurrogateSelector is private, and needs to be set by the embedder trough reflection, so we do not expose any public
// API point that is not present in .NET
static ISurrogateSelector DefaultSurrogateSelector { get; set; }

public FormatterAssemblyStyle AssemblyFormat
Expand Down