There are some rules that I want to ignore in my .NET project. I would like to do it in the .csproj file, or any other file which I can version control.
I have tried to define it in my .csproj like this:
Then I get the following error: WARN: Specifying issue exclusions at module level is not supported anymore. Configure the property ‘sonar.issue.ignore.multicriteria’ and any other issue exclusions at project level.
I see, but I would like to solve it in a config file, which is tied to the project, and is on github. I wouldn’t like to set it up in Sonar, so when the project moves to another instance in the future, it would have to be set up again.
So I understand that the UI is the easiest way, but your answer implies there IS another way.
And I would need help solving it this way.
Thank you for the documentation link.
Unfortunately it’s not mentioned there, but it’s such a common scenario I would think it should be possible…
Especially considering the error message states that it’s not supported anymore → it was someday…
I have also tried specifying it through command line arguments, then the error I got was this: Specifying module-relative paths at project level in property ‘sonar.issue.ignore.multicriteria’ is deprecated.
So this feature worked in multiple ways in the past, now I can’t find a way for it to work, and documentation doesn’t mention it either.
It’s possible to set exclusions via analysis parameters, but it is not optimal. You’ve already figured out the parameter names. Now you just need to know where to put them. I believe the docs I sent you to cover that.
I just didn’t have access to that as it’s on a remote build server, but now I have access so I could try it out.
Now I just have to set it up so that the .xml comes from our repository, and it’s done.
And yeah, it was mentioned in the docs that such file exists, just didn’t know what’s the difference between this and setting properties in the .csproj.