Suppression via preprocessor directive is considered unnecessary for some diagnostics
- Dominant language
- C#
- Stars
- 20.7k
- Forks
- 4.3k
- PR merge metrics
- PR metrics pending
Description
**Full issue information + repro project**:
https://github.com/just-ero/roslyn-issues-repros/tree/main/5.0.0/000_CustomDiagnosticSuppression
### Version
**Roslyn**: 5.0.0-1.25204.1 (ad1c386d)
### Steps to Reproduce
1. Add the following code wherever syntactically applicable:
```cs
#pragma warning disable SYSLIB1054
class C
{
[DllImport("_")]
static extern void M();
}
```
2. Target .NET 7.0 or higher.
### Expected Behavior
The suppression of `SYSLIB1054` is not considered unnecessary.
### Actual Behavior
It is.
---
 
Contributor guide
Assessment
This issue has not been assessed yet.