How to scan C with sonarqube C#?

Recently, Jenkins integrated sonarqube. When calling sonarscanner for msbuild to scan C#, the scan failed. The specific configuration is as follows:


The output of Jenkins console is as follows:

The output of sonarqube is as follows:

From the above picture, we can see that there is no loophole in the C# code. How can I configure it to scan the C# code? Please give me some advice. Thank you very much!

Hi,

Welcome to the community!

You’ve got two different things going on here. You got an “analysis successful” message. That means that the SonarQube part is over; the analysis report has been bundled and sent off to the server for processing:
Selection_999(268)

Your error message is coming from another process:
Selection_999(269)

That particular error you need to take up with whomever supports the PDF Report process.

So now let’s come back to your blank homepage. From the graph on the right of your homepage it looks like previous analyses were successful. So the question is “what changed?”

 
Ann

First of all, thank you very much for your reply!

The previous project was to scan java code, and then it was modified based on the original project. It was modified to use sonarscanner for msbuild tool to scan C#, so the same projectKey was used. Therefore, it was the result of Java code scanning before. However, when it is configured to scan C#, the scanning result is empty. I don’t know where the problem is. Can you help me to analyze it again? Thank you very much!
Here is a list of questions on sonarqube.

Hi @baiguanghui,

Welcome to the community.

Did you check our documentation page on this topic? Make sure you select the correct SonarQube version on the top-left corner. You might find interesting information here too.

In case this doesn’t help, I’d like to be provided with technical information on your setup (SonarQube version for instance, sonar-scanner for MSBuild version, etc). A full copy of the scanner logs might help too.

Cheers

1 Like

Thank you very much for your reply. I will check it later and give you a reply. Hope to keep in touch!

According to the information obtained, the C# project is developed with msbuild12, but when Jenkins compiles the C# project, the msbuild14 version must be called. Is it due to the inconsistency between the project development version and the msbuild version called by Jenkins? I hope to get your reply as soon as possible.thank you very much.

@baiguanghui Please provide a detailed scanner logs in order to investigate further.