套接字异常:无法建立连接,因为目标计算机主动拒绝连接,Getting These error in .NET Core 5 With angular app

kgsdhlau  于 2023-03-09  发布在  .NET
关注(0)|答案(1)|浏览(228)

处理请求时发生未处理的异常。
我得到这些错误,每次我运行我的应用程序在visual studio

An unhandled exception occurred while processing the request.
SocketException: No connection could be made because the target machine actively refused it.
System.Net.Sockets.Socket+AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)

HttpRequestException: No connection could be made because the target machine actively refused it. (localhost:53797)
System.Net.Http.ConnectHelper.ConnectAsync(Func<SocketsHttpConnectionContext, CancellationToken, ValueTask<Stream>> callback, DnsEndPoint endPoint, HttpRequestMessage requestMessage, CancellationToken cancellationToken)

HttpRequestException: Failed to proxy the request to http://localhost:53797/, because the request to the proxy target failed. Check that the proxy target server is running and accepting requests to http://localhost:53797/.

The underlying exception message was 'No connection could be made because the target machine actively refused it. (localhost:53797)'.Check the InnerException for more details.
Microsoft.AspNetCore.SpaServices.Extensions.Proxy.SpaProxy.PerformProxyRequest(HttpContext context, HttpClient httpClient, Task<Uri> baseUriTask, CancellationToken applicationStoppingToken, bool proxy404s)
oxosxuxt

oxosxuxt1#

有两件事我想让你试试-
1.尝试将http更改为https
1.检查启动设置并请求正确的端口号。
请参见以下屏幕截图x1c 0d1x

相关问题