RemoteDebugging TCP Connection Failure

Cannot run Remote Debugging from Studio due to error "No connection could be made because the target machine actively refused it. Please make sure that the debugging agent is started and accessible".

Before running a project in Remote Debug mode from Studio, make sure that the setup is completed as per the Remote Debugging documentation.

In the case the setup is correctly configured, an error message is thrown:

  • "No connection could be made because the target machine actively refused it. Please make sure that the debugging agent is started and accessible".

Resolution:
This may be caused by the fact that the port used is blocked. 8573 is the default port, but use a different port as long as it is open and listening. Verify this.

If the port is opened and listening, it may not allow inbound TCP communication.

  1. One possible solution is to create a specific Inbound Rule in the Windows Defender firewall. Appropriate permission is required.
  2. On the target computer, launch Windows Defender firewall > Advanced Settings > Inbound rules > New Rule
  3. Choose Port as a rule type > Next > TCP as port type > Specific local ports > 8573 (or another port if another app uses this one)
  4. Next > Choose action as "Allow the connection"
  5. When does this rule apply? Leave all of them enabled.
  6. Name > Give your rule a name.