0
respostas

SocketException: Nenhuma conexão pôde ser feita porque a máquina de destino as recusou ativamente

Boa noite. Poderiam me ajudar com o erro abaixo? Já revi o código mil vezes.... Acontece quando tento executar ao final do tópico 5 da primeira aula do curso 2. Quando executo consigo ir até o Lista de Leitura com todos os Livros mas se tento detalhar apenas um livro aparece essa mensagem de Exception. Desde já agradeço.

An unhandled exception occurred while processing the request. SocketException: Nenhuma conexão pôde ser feita porque a máquina de destino as recusou ativamente System.Net.Http.ConnectHelper.ConnectAsync(string host, int port, CancellationToken cancellationToken)

HttpRequestException: Nenhuma conexão pôde ser feita porque a máquina de destino as recusou ativamente System.Net.Http.ConnectHelper.ConnectAsync(string host, int port, CancellationToken cancellationToken)

Stack Query Cookies Headers SocketException: Nenhuma conexão pôde ser feita porque a máquina de destino as recusou ativamente System.Net.Http.ConnectHelper.ConnectAsync(string host, int port, CancellationToken cancellationToken)

Show raw exception details HttpRequestException: Nenhuma conexão pôde ser feita porque a máquina de destino as recusou ativamente System.Net.Http.ConnectHelper.ConnectAsync(string host, int port, CancellationToken cancellationToken) System.Threading.Tasks.ValueTask.get_Result() System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) System.Threading.Tasks.ValueTask.get_Result() System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask<ValueTuple<HttpConnection, HttpResponseMessage>> creationTask) System.Threading.Tasks.ValueTask.get_Result() System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, bool doRequestAuth, CancellationToken cancellationToken) System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task sendTask, HttpRequestMessage request, CancellationTokenSource cts, bool disposeCts) Alura.ListaLeitura.WebApp.Controllers.LivroController.Detalhes(int id) in LivroController.cs + HttpResponseMessage resposta = await httpClient.GetAsync($"livros/{id}"); Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor+TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, object controller, object[] arguments) System.Threading.Tasks.ValueTask.get_Result() Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync() Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync() Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync() Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter() Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context) Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync() Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync() Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext) Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)