You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
valhristov
changed the title
SuppressMessage with nonexistent category and check ID still suppresses issues
Fix S2325: Methods and properties with attribute do not raise issues
Aug 3, 2017
valhristov
changed the title
Fix S2325: Methods and properties with attribute do not raise issues
Fix S2325: Should raise issues for methods and properties with SuppressMessage attribute
Aug 8, 2017
We decided to allow raising issues only if there is a SuppressMessage attribute. If other attributes are present we will not raise in order to reduce the false positives when using attribute-based functionality such as serialization, WCF, etc...
Description
Methods and properties with an attribute do not raise issues.
Repro steps
Define the following method and make sure S2325: Methods and properties that don't access instance data should be static is enabled:
Note
S2325
is reported. Now add the following suppression attribute:Expected behavior
The issue should remain, since the proper category (
pitfall
?) and check ID (S2325
) weren't supplied.Actual behavior
The issue is suppressed.
Known workarounds
Use
#pragma warning disable
/#pragma warning restore
Related information
6.2.0.2536
The text was updated successfully, but these errors were encountered: