0
I am starting the journey to learn ASP.NET Core and when I try to run the application I have the following error:
An unhandled Exception occurred while Processing the request. Socketexception: No connection could be made as the machine fate actively refused them System.Net.Http.ConnectHelper.Connectasync(string host, int port, CancellationToken cancellationToken)
Httprequestexception: No connection could be made as the machine of fate actively refused them System.Net.Http.ConnectHelper.Connectasync(string host, int port, CancellationToken cancellationToken)
Httprequestexception: Failed to proxy the request to http://localhost:4200/, because the request to the proxy target failed. Check that the proxy target server is running and Accepting requests to http://localhost:4200/.
The underlying Exception message was 'No connection could be made because the destination machine has actively refused them'. Check the Innerexception for more Details. Microsoft.AspNetCore.Spaservices.Extensions.Proxy.SpaProxy.Performproxyrequest(Httpcontext context, Httpclient httpClient, Task baseUriTask, Cancellationtoken applicationStoppingToken, bool proxy404s)
I thought maybe it could be some problem with CORS, but both client and server are together, so that shouldn’t be the problem.
This error can be caused if any service is using the same port
– Aesir
I think not, I used NESTAT to see and there is no one using this door. The ISS generates two port options and the problem happens in both.
– Ronaldo Lopes
Use p
nestat -anb
after starting IIS to see if it is running and with the expected port. This could be the wrong port, it could be a firewall blocking the connection, it might not really be active...– Ronaldo Araújo Alves
There is a VM (Vmware) running on this port, with the command nestat -anb appeared. Unfortunately I cannot stop or change the port of this service. You can change the application port?
– Ronaldo Lopes
a silly question... you are trying to access the application from the same machine on which it is running, right?
– Leandro Angelo