Skip to content

Remove obsolete ISerializable constructors (SYSLIB0051) #322

Description

Summary

Two custom exception classes implement the obsolete ISerializable pattern inherited from .NET Framework, producing SYSLIB0051 warnings on every build:

  • ApiDoctor.Validation/Http/HttpParserRequestException.cs:46
  • ApiDoctor.Validation/Params/PlaceholderValueNotFoundException.cs:46

Both have a constructor of the form:
```csharp
protected MyException(SerializationInfo info, StreamingContext context) : base(info, context)
```

Why this should be fixed

In .NET 8, BinaryFormatter and the ISerializable infrastructure were deprecated. This constructor is marked [Obsolete] via SYSLIB0051. The constructors are never called anywhere in the codebase — they exist solely to satisfy the old pattern.

Fix

Delete the protected serialization constructors from both classes. No callers need updating.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions