No connection could be made because the target machine actively refused it

Hi.

We use dotnet core 2.2 and when I try to build I get this error message:
Using the .NET Core version of the Scanner for MSBuild
Pre-processing started.
Preparing working directories…
14:47:38.48 Updating build integration targets…
14:47:38.548 Fetching analysis configuration settings…
14:47:40.653 Failed to request and parse ‘http://localhost:9000/api/server/version’: No connection could be made because the target machine actively refused it No connection could be made because the target machine actively refused it

it looks like from: https://docs.sonarqube.org/display/SCAN/Install+the+SonarScanner+for+MSBuild
that 2.2 is not supported.

But then again that error message looks like a firewall issue. If so, how´s the connection flow here and how can it be fixed?

/tyskland

Hi tyskland,

Which ALM are you using ?

Mickaël

Hi,

Bitbucket

But now I just tested to run it locally.

Nevermind. I didn´t see the documentation about the sonarcube server since it was barely mentioned.

https://docs.sonarqube.org/display/SCAN/Install+the+SonarScanner+for+MSBuild
Only mentioned here: * See this Quick Installation Guide if you never installed a SonarQube server.

I thought this was enough:
dotnet tool install --global dotnet-sonarscanner
dotnet sonarscanner begin /k: "project-key"
dotnet build <path to solution.sln>
dotnet sonarscanner end

because if you click on :
Download SonarScanner for MSBuild.

you are just forwarded back to
https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+MSBuild
in a neat little confusing loop

Solved for now!
Thanks

This error is a network-related error occurred while establishing a connection to the Server. It means that the error is occurring because there is no server listening at the hostname and port you assigned. It literally means that the machine exists but that it has no services listening on the specified port .

Generally, it happens that something is preventing a connection to the port or hostname. Either there is a firewall blocking the connection or the process that is hosting the service is not listening on that specific port. This may be because it is not running at all or because it is listening on a different port. More on…no connection