Disable some C# compiler warnings on PR in Azure Devops

Template for a good new topic, formatted with Markdown:

  • ALM used - Azure DevOps
  • CI system used - Azure DevOps
  • C#

We are using “Obsolete” attribute in our codebase. Sonarcloud is reporting every use of obsoleted property on PR as a comment (CS0618 compiler warning).
We’d like to stop this behavior on PR, without removing this warning from our compilation.

Is there a way to configure SonarCloud to work this way? We still want local developers to see compiler warnings, but we don’t want those particular warnings being reiterated by SonarCloud on PR as remarks.

This is very important for us because currently, Sonar is creating so much noise for us that we are considering disabling it.

1 Like

Hi,

We automatically report all compiler warnings with the analysis. Sorry, but there’s no way to get them in your build without getting them in SonarCloud as well.

But I’ll make sure the product team is aware of your need.

Is it possible to have one configuration for developers to run locally and another for the ‘production’ run?

 
Ann

Hi Konrad,

Thank you for your contribution!
As Ann said, unfortunately we do not have a solution for separating warning between compilation and analysis.

I created an entry in our system to record your need so we can consider this feature in the future.

Denis

Do you support compiler warnings for java?

Hi @Sharad_Garg,

Welcome to the community!

We do not support compiler warnings for other languages. This is only relevant in a .NET context.

 
Ann