Specifying module-relative paths at project level in the property 'sonar.exclusions' is deprecated

Specifying module-relative paths at project level in the property ‘sonar.exclusions’ is deprecated. To continue matching files like ‘project_name/Program.cs’, update this property so that patterns refer to project-relative paths.

Hello. I am getting this warning on my Sonarqube project’s dashboard. Unfortunately, I do not have admin rights. Any idea how this can be sorted out?

Where are you setting your exclusions?

  • In the UI (your project’s Administration > General Settings > Analysis Scope (in which case, you’ll need a project admin to help you out)
  • Or somewhere else (pipeline configuration, .csproj files in your solution)? Here, you don’t need to be a project admin to adjust these.

Hello Colin. Thank you so much for you answer. I have one question though. If my dashboard looks something like in the image attached, we can say for sure that I don’t have admin rights, correct? I have to edit my project’s .csproj file to obtain the desired changes.

Yes, it means you don’t have Project administrator rights.

But you’ll only be able to suppress the warning if the exclusions are set in your project’s .csproj file, rather than in the project administration UI. If you’ve found the exclusions in your .csproj file, you’re in the right place.

Hello Colin. I have added the following lines of code in my .csproj file, but I am still getting the warning. Any idea?

image

It looks like you’ve set sonar.coverage.exclusions instead of sonar.exclusions as noted in your error message. Try setting the one referenced in your error message!