How can I implement ISerializable in .NET 4+ without violating inheritance security rules?

According to the MSDN, in .NET 4.0 basically you should not use ISerializable for partially trusted code, and instead you should use ISafeSerializationData Quoting from https://learn.microsoft.com/en-us/dotnet/standard/serialization/custom-serialization Important In versions previous to .NET Framework 4.0, serialization of custom user data in a partially trusted assembly was accomplished using the GetObjectData. Starting with version 4.0, that method … Read more