Skip to content

Adding Microsoft.CodeAnalysis.BannedApi as suggested for SignalR MessagePackHubProtocol #18290

Closed
@tebeco

Description

@tebeco

Is your feature request related to a problem? Please describe.

I was trying to do update MessagePack to 2.0.x but as few things changed like the introduction of MessagePackSerializerOptions.
As i forgot to properly instantiate it @AArnott suggested here to use Microsoft.CodeAnalysis.BannedApi :

Use the Microsoft.CodeAnalysis.BannedApiAnalyzers package and add a banned api file to ban all APIs that do not include the options in order to stay on the safe side.
MessagePack-CSharp/MessagePack-CSharp#534 tracks making this easier.

Describe the solution you'd like

Trying to check if such analyzer makes sense and could be used here

Additional context

As i'm submitting this issue, i began to read :
MessagePack-CSharp/MessagePack-CSharp#534
MessagePack-CSharp/MessagePack-CSharp#533
https://github.com/dotnet/roslyn-analyzers/blob/master/src/Microsoft.CodeAnalysis.BannedApiAnalyzers/Microsoft.CodeAnalysis.BannedApiAnalyzers.md
https://github.com/dotnet/roslyn-analyzers/blob/master/src/Microsoft.CodeAnalysis.BannedApiAnalyzers/BannedApiAnalyzers.Help.md
https://github.com/dotnet/csharplang/blob/master/spec/documentation-comments.md#id-string-format

But i'm not sure how to setup properly this analyzer to be honest.
Especially since the Banned Methods for MessagePack are one with either/both ref and optional parametters so i'm not sure it's going to kicks in properly

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-signalrIncludes: SignalR clients and serverstask

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions