No connection could be made because the target machine actively refused

Must-share information (formatted with Markdown):
I am new to SonarQube. I use the sonar-scanner-msbuild-5.3.1.36242-net46 to scan an c#.net application.
I run the sonarScanner.msbuild as this:
SonarScanner.MSBuild.exe begin /k:“Project Name” /d:sonar.login=“Key”

It throws the error:

SonarScanner for MSBuild 5.3.1
Using the .NET Framework version of the Scanner for MSBuild
Pre-processing started.
Preparing working directories…
17:43:27.728 Updating build integration targets…
17:43:31.916 Failed to request and parse ‘http://localhost:9000/api/server/version’: An error occurred while sending the request.

Unhandled Exception: System.Net.Http.HttpRequestException: An error occurred while sending the request. —> System.Net.WebException: Unable to connect to the remote server —> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:9000
at System.Net.Sockets.Socket.InternalEndConnect(IAsyncResult asyncResult)
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
— End of inner exception stack trace —
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)


Please advise what it wrong

I found the solution myself.
I need to specify url for the command

1 Like

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