MSBuild Sonar scanner

I want to scan the C# file in the sonarqube for which I am using jenkins , for python I have already setup the same but it was done through “execute sonarscanner” and for C# I have to use “execute sonarscanner for MSbuild”.

Can anyone what are the steps I need to do . I have also tried to some setting but got failed.




Based on your second screenshot, your project uses non-UTF-8 characters? If so, you need to provide (probably in Additional arguments) sonar.sourceEncoding


Hello Ann ,

I got the same result . I wrote sonar.sourceEncoding in the additional argument as well as I also tried the same by writing sonar.sourceEncoding=UTF-8 got the same result .

I am new for scanning a C# code .

Your help will be appreciated .



I’m a bit out of my depth at this point. This thread is already flagged for more expert attention. Hopefully they’ll be along soon.



From you logs, it seems you are running on a Linux slave, but you have selected a Scanner for MSBuild for .NET 4.6. This is AFAIK not compatible.
You should probably select a Scanner for MSBuild for .NET Core.

The command would then look like:
dotnet /path/to/SonarScanner.MSBuild.dll /k:xxx xxxx

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.