Failure using SonarScanner for .NET

When I was configuring the SonarScanner for .NET tool, I encountered the following problem that I could not solve, and I could not find more detailed logs.
How can I solve this problem?

SonarqubeVersion: 10.6.0.92116
SonarScanner for .Net Version: 8.0.197834

Hi,

Could you try to reach said URL directly?
For example running

curl HTTP://localhost:9000/api/server/version

What is the result?
If there is an error, then you have an issue on your server, or the way things are configured.
How are you running SonarQube locally?

Denis

Hi Denis,

Thanks for your reply.
In the screenshot of my question, there is a curl link, which can return the Sonarqube version number normally.

The main reason is that I can’t find more information that can help me analyze the cause of the error, so I don’t know how to solve it.

Regards,
Evan

The following are screenshots of Sonarqube I started and the management login.
From the start of the service, there is no error.


Hey @Evan.Lin,
Is it possible that you are connecting to SQ via proxy or VPN? If so, please take a look here:

Hi Tim,

My machine does have a proxy set up, but my Sonarqube server is started on my local machine. Will this also be affected by the proxy?

If it is affected, how can I solve it? From the link you sent me, I didn’t find a place to set the proxy on the client side.

Regards,
Evan

Today I tried to close the proxy and run sonarscanner, and it reported the following error, which is different from before. But when I open the proxy again, it still reports this error.

I have no idea what the reason is.
Is there any more detailed information that can be provided to analyze the cause?

Surprisingly, after I removed the token in the SonarQube.Analysis.xml configuration and the token in the execution command, the error no longer occurred.


Hi @Evan.Lin,
I’m glad it’s working now! Maybe you had the token configured incorrectly, somehow. Where is the token stored now? It should only be needed in one place.

I have not configured a token anywhere. I directly generated a global token on the server.
Then I removed all the tokens in the following three places:

C:\WeakScanner\SonarQube\sonar-scanner-8.0.1.97834-net\SonarQube.Analysis.xml
C:\Users\appeon\.dotnet\tools\.store\dotnet-sonarscanner\8.0.1\dotnet-sonarscanner\8.0.1\tools\netcoreapp3.1\any\SonarQube.Analysis.xml
dotnet-sonarscanner begin /k:"DesignerWebApp1" /d:sonar.host.url="http://localhost:9000" /d:"sonar.verbose=true"

And then it compiled successfully.