S3925: Should be reconsidered for implementing ISerializable

Since .NET 8, Microsoft dropped all format-based/binary serialization. I would expect this rule not to be raised on .NET 8 (and higher) targeted code, For .NET 7 and below, I would not suggest any change.

[Serializable]
public class CurrencyMismatchException : Exception // Compliant for .NET 8
{
    public CurrencyMismatchException() { }

    public CurrencyMismatchException(string message) : base(message) { }

    public CurrencyMismatchException(string message, Exception inner) : base(message, inner) { }

    public CurrencyMismatchException(Currency cur0, Currency cur1, string operation)
        : this(string.Format(QowaivMessages.CurrencyMismatchException, operation, cur0, cur1)) { }
}

Hey Corniel,

What do you mean by “dropped all format-based/binary serialization”?
What changes in this class as to how it is serialized?
Could you link me what you are referencing?

Thanks in advance,
Greg

Hey Corniel,

I finally found some time to load the context, and your observation is as usually astute.
I made a ticket to track this effort, and there is already some internal discussion around it.

Please track the progress there, as we normally do.

Thanks as always,
Greg

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.