.Net Tips – use [field:NonSerialized] to stop serializing your event handlers
In C#, when you define an event in your class, e.g.: the event handlers will be serialized along with other properties, etc. This is because under the hood, the compiler translates your event into the following, as can be seen through JetBrain’s dotPeek decompiler: Since the generated EventHandler is not marked with the [NonSerialized] attribute …
.Net Tips – use [field:NonSerialized] to stop serializing your event handlers Read More »