Skip to content
This repository was archived by the owner on Nov 12, 2026. It is now read-only.
This repository was archived by the owner on Nov 12, 2026. It is now read-only.

CA2ß16: Ignore deprecated overloads #6819

Closed

Description

@thomasneubergersdx

Analyzer

Diagnostic ID: CA2016

Describe the improvement

If the overload that takes a CancellationToken is deprecated, this rule should not fire.

Describe suggestions on how to achieve the rule

The Linq query in the beginning of the MethodHasCancellationTokenOverload method could filter methods with the ObsoleteAttribute attached to them.

Additional context

For example, the interface Microsoft.SematicKernel.IKernel (package version 0.18.230725.3-preview) has the method CreateNewContext with and without the CancellationToken parameter. The overload with the parameter is marked as deprecated.

In this case, imo the overload without the parameter schould be used, since using the other one would be much more dangerous.

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