2023-07-04 15:32:38 +02:00
== Why is this an issue?
Serialization event handlers that don't have the correct signature will not be called, bypassing augmentations to the automated de/serialization.
A method is designated a serialization event handler by applying one of the following serialization event attributes:
2023-07-06 11:15:01 +02:00
* https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.onserializingattribute[`OnSerializingAttribute`]
* https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.onserializedattribute[`OnSerializedAttribute`]
* https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.ondeserializingattribute[`OnDeserializingAttribute`]
* https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.ondeserializedattribute[`OnDeserializedAttribute`]
2023-07-04 15:32:38 +02:00
2023-07-06 11:15:01 +02:00
Serialization event handlers take a single parameter of type https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.streamingcontext[`StreamingContext`], return `void`, and have `private` visibility.
2023-07-04 15:32:38 +02:00
This rule raises an issue when any of these constraints are not respected.