How to create a SerializationBinder for the Binary Formatter that handles the moving of types from one assembly and namespace to another

This could work (instead of your override). public override Type BindToType(string assemblyName, string typeName) { var m = Regex.Match(typeName, @”^(?<gen>[^\[]+)\[\[(?<type>[^\]]*)\](,\[(?<type>[^\]]*)\])*\]$”); if (m.Success) { // generic type var gen = GetFlatTypeMapping(m.Groups[“gen”].Value); var genArgs = m.Groups[“type”] .Captures .Cast<Capture>() .Select(c => { var m2 = Regex.Match(c.Value, @”^(?<tname>.*)(?<aname>(,[^,]+){4})$”); return BindToType(m2.Groups[“aname”].Value.Substring(1).Trim(), m2.Groups[“tname”].Value.Trim()); }) .ToArray(); return gen.MakeGenericType(genArgs); } return GetFlatTypeMapping(assemblyName,typeName); } … Read more

Is it possible to do .NET binary serialization of an object when you don’t have the source code of the class?

You could create a serialization surrogate. Imagine that we have a class defined in a referenced assembly that we have no control over that looks like this: public class Person { public string Name { get; set; } public int Age { get; set; } public DriversLicense License; } // An instance of this type … Read more

deneme bonusu veren sitelerbahis casinomakrobetceltabetpinbahispolobetpolobet girişpinbahis girişmakrobet girişpulibet girişmobilbahis girişkolaybet giriş