Home > OS >  VS2022 showing unused suppression, but failing on build
VS2022 showing unused suppression, but failing on build

Time:04-29

I'm running visual studio, I taken latest code repository. One method has System.Diagnostics.CodeAnalysis.SuppressMessage attribute on it, on hover its showing unused suppression. But while I build the project it throws error.

enter image description here

While building it getting this error(Method has ToLower() without and any culture).

enter image description here

I don't want any code change, because it's running code and someone already has added suppression over it. Is my VS creating this issue, any help to fix it. Thanks in advance.

CodePudding user response:

Read the suppressed numbers, they're CA2000, CA1304 and CA2202. Your warning (that you chose to treat as an error) is CA1305, which is not part of the suppressed list.

I don't want any code change, because it's running code and someone already has added suppression over it

Someone has added the wrong suppression numbers, probably copy & pasted. That's not quite the same.

  • Related