I understand we need it to mark a class whose objects can be serialized, but do we strictly need this for behind the hood logic to work? We could just serialize the object using necessary methods. On the other hand, if we want to prevent serialization, then having this attribute makes sense, in that case [NonSerialized()]
becomes redundant.
Considering syntax and semantics, what is the necessity of this attribute?
[Serializable]
) mostly disappeared from .NET Core I think tells you a lot about it. (Yes, I know it's somewhat back in .NET Core 2.x).