Reputation: 97
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
Reputation: 2850
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 warnings
preprocessor directive : https://msdn.microsoft.com/en-us/library/441722ys.aspx
Upvotes: 1