In some generated code, which I cannot change and for which I cannot modify the generator, after updating to .NET 8, I get a number of SYSLIB0051 warnings. I thought it should be straightforward to suppress them using a global suppressions file.
However, I cannot find the correct Category (maybe "Compiler"?), CheckId, and maybe MessageId and Scope that the SuppressMessageAttribute requires.
How can I suppress this message in a global suppressions file and/or where can I find the necessary information?
One approach is to use
#pragmadirectives around the code causing the issues if you want to target specific areas of concern.For example in your case, wrap the line(s) with: