Skip to content

[Bug — BannedApiAnalyzers] Namespace (N:XXX) level triggers are not working as expected or intended #82047

@QuantumToasted

Description

@QuantumToasted

Hello, this is my first time using the BannedApiAnalyzers package. I'm following the instructions/guide listed here, and it mentions that to ban all members of a namespace, one should use the N:XXX;Comment directive.

As such, my BannedSymbols.txt contains the following:

N:Microsoft.EntityFrameworkCore;Prefer Linq2DB methods and types instead.

As this is being done at the solution level, I expected this to have nuclear results as one of the projects directly consumes Microsoft.EntityFrameworkCore. I did so intentionally just to test the feature. However, I was surprised to find that nothing was flagged at all - types, properties, or methods.

I've included a slightly-less-than-minimal repro of this, and it can be cloned here. I included a dummy method which intentionally and explicitly accesses members that are supposed to be banned, and yet they remain able to be used freely.

I did my due diligence to ask around the community before opening this issue to see if it was something I had missed or done wrong, but they remained stumped themselves, so I am wondering if this is a bug or oversight of some sort.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions