How can I implement ISerializable in .NET 4+ without violating inheritance security rules?
问题 Background: Noda Time contains many serializable structs. While I dislike binary serialization, we received many requests to support it, back in the 1.x timeline. We support it by implementing the ISerializable interface. We've received a recent issue report of Noda Time 2.x failing within .NET Fiddle. The same code using Noda Time 1.x works fine. The exception thrown is this: Inheritance security rules violated while overriding member: 'NodaTime.Duration.System.Runtime.Serialization