Custom Serialization - ISerializable and Secure / Closed Constructor for Deserialization

I don’t understand how this works: when I implement the ISerializable interface, I have to define protected (unless the class is sealed, in which case the constructor should be marked as private) constructor:
protected MyClass(SerializationInfo info, StreamingContext context)
Does this access modifier make this constructor unsuitable for any object in the project to succeed in deserialization?

+4
source share

Source: https://habr.com/ru/post/1489771/


All Articles