user2332131
user2332131

Reputation: 97

Mark as false positive

how can I mark a false positive in Sonarmint? Adding just //NOSONAR was not working for me.

((IClientChannel)channel).Close();

It's saying I should review this cast because there's no type in this project that implements both interfaces. That's clear as IClientChannel comes from System.ServiceModel.IClientChannel and channel is my WCF channel.

Best regards

Upvotes: 0

Views: 478

Answers (1)

The question is in fact "How to suppress compiler/analysis warnings in Visual Studio" because SonarLint embeds its own SonarAnalyzer for C# and VB.Net which rely on Roslyn. And one way is to use the #pragma warningspreprocessor directive : https://msdn.microsoft.com/en-us/library/441722ys.aspx

Upvotes: 1

Related Questions