Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSSDK006 fires when validation is in another method #111

Open
sherryyshi opened this issue Nov 13, 2019 · 1 comment
Open

VSSDK006 fires when validation is in another method #111

sherryyshi opened this issue Nov 13, 2019 · 1 comment

Comments

@sherryyshi
Copy link
Member

I would like to report telemetry when a service is null, so I'm validating my services with another method rather than calling Assumes.Present, or duplicating bunch of if-null blocks. However, VSSDK006 doesn't detect that.

FXCop's CA1602 addresses this by looking at the [ValidatedNotnull] attribute on the validation method (see dotnet/roslyn-analyzers#2863 (comment)). Any chance something similar can be done here?

AArnott added a commit that referenced this issue Apr 14, 2022
It actually does something useful, and will soon be mandated.
@AArnott
Copy link
Member

AArnott commented Apr 4, 2024

Another instance of this occurs here, where is not null is used to test a nullable-annotated field where GetService's result is stored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants