How can I globally suppress the warning IDE1006 Naming Rule Violation in Visual Studio 2017 for MAC?
All the answers I found here probably refer to a tab in the options dialog on windows that doesn't seem to be present/available in the MAC version.
I found a global suppression file called GlobalSuppressions.cs, which I added the following to:
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "TBD", Scope = "member", Target = "*")]
Which doesn't help, unfortunately.
Use menu Visual Studio > Preferences > Text Editor > Source Analysis > C# >Code Rules and look in the list for "IDE1006" and change the Action to "Hidden"

Alternately, you can hover over the squiggly line under the name, click on the "tip" icon to open a submenu, then select Suppress > Suppress IDE1006 > In Suppression file:

That should add the GlobalSuppression.cs file to the project and populate it with the necessary attribute to suppress the warning for that specific method:
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "<Pending>", Scope = "member", Target = "~M:MyNamespace.MyType.swe_calc(System.Double,System.Int32,System.Int32,System.IntPtr,System.IntPtr)~System.Int32")]
If you select In Source, then an inline #pragma compiler directive is added to the source code file around the method in question.
Since you seem to want this always ignored, then go with the first option in the Preferences which worked to suppress the warning on my end.
AS for why your SuppressMessage attribute did not work, I don't think you can use "*" for the Target. See the docs: https://learn.microsoft.com/en-us/visualstudio/code-quality/in-source-suppression-overview?view=vs-2017#global-level-suppressions
Note
Target always contains the fully qualified item name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With