I am getting intermittent errors when using the Google translation C# APIs. Weirdly enough I never ever get the error on my local PC, it's only when I run it on our Test and Prod servers do I get the error.
The code is straightforward.
var credential = GoogleCredential.FromJson(#"
{
// .....text from my google credentials json file
}");
var client = TranslationClient.Create(credential);
var response = client?.TranslateText("Hello World.", "fr");
The error I get is
System.Net.Http.HttpRequestException: No connection could be made because the target machine actively refused it ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it
at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at Google.Apis.Http.ConfigurableMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
at Google.Apis.Auth.OAuth2.Requests.TokenRequestExtenstions.ExecuteAsync(TokenRequest request, HttpClient httpClient, String tokenServerUrl, CancellationToken taskCancellationToken, IClock clock)
at Google.Apis.Auth.OAuth2.ServiceAccountCredential.RequestAccessTokenAsync(CancellationToken taskCancellationToken)
at Google.Apis.Auth.OAuth2.TokenRefreshManager.RefreshTokenAsync()
at Google.Apis.Auth.OAuth2.TokenRefreshManager.ResultWithUnwrappedExceptions[T](Task`1 task)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
at Google.Apis.Auth.OAuth2.TokenRefreshManager.GetAccessTokenForRequestAsync(CancellationToken cancellationToken)
at Google.Apis.Auth.OAuth2.ServiceAccountCredential.GetAccessTokenForRequestAsync(String authUri, CancellationToken cancellationToken)
at Google.Apis.Auth.OAuth2.ServiceCredential.InterceptAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at Google.Apis.Http.ConfigurableMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
at Google.Apis.Requests.ClientServiceRequest`1.ExecuteUnparsedAsync(CancellationToken cancellationToken)
at Google.Apis.Requests.ClientServiceRequest`1.Execute()
at Google.Cloud.Translation.V2.TranslationClientImpl.TranslateText(IEnumerable`1 textItems, String targetLanguage, String sourceLanguage, Nullable`1 model)
at Google.Cloud.Translation.V2.TranslationClient.TranslateText(String text, String targetLanguage, String sourceLanguage, Nullable`1 model)
at QuickStart.Main(String[] args)
I suspect the error is in the authentication code. Curiously it seems to work on the servers in spurts, so connects and translates fine for a period of time, and then stops to do so, throwing the aforementioned error.
Do I need a separate key for every server?
As I said before works flawlessly on my PC - Every. Single. Time.
I am on the currently on a basic account, so not sure if there are any thresholds that I am breaching, but could not find anything in the documentation.
Related
When I use Sikuli in C# Selenium I am getting below error
System.Net.WebException : No connection could be made because the target machine actively refused it. [::1]:8080 (localhost:8080)
----> System.Net.Http.HttpRequestException : No connection could be made because the target machine actively refused it. [::1]:8080 (localhost:8080)
----> System.Net.Internals.SocketExceptionFactory+ExtendedSocketException : No connection could be made because the target machine actively refused it. [::1]:8080
Stack Trace:
HttpWebRequest.GetResponse()
Screen.MakeRequest(String requestURLExtension, String jsonObject)
Screen.Find(Pattern pattern, Boolean highlight)
Login.StartBrowser() line 57
--HttpRequestException
HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
HttpConnectionPool.AddHttp11ConnectionAsync(HttpRequestMessage request)
TaskCompletionSourceWithCancellation`1.WaitWithCancellation(CancellationToken cancellationToken)
<12 more frames...>
Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
Socket.Connect(EndPoint remoteEP)
Socket.Connect(IPAddress[] addresses, Int32 port)
--- End of stack trace from previous location ---
Socket.Connect(IPAddress[] addresses, Int32 port)
Socket.Connect(String host, Int32 port)
Socket.Connect(EndPoint remoteEP)
<<CreateHttpClient>b__1>d.MoveNext()
--- End of stack trace from previous location ---
HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
Standard Output:
--Log for this test run can be found at: C:\Users\Sreeram.Potti\OneDrive - EY\Documents\Development\Automation\automation\kimautomation\bin\Debug\net6.0\Sikuli4Net.Client.Logs\log.29-11-20221252.txt--
:::Making Request to Service: http://localhost:8080/sikuli/api/find POST: {"jPattern":{"imagePath":"C:\\Logo\\Logo.jpg","offset_x":0,"offset_y":0,"similar":0.7},"highlight":false}:::
(result has additional output)
This is the code I am used to test. If I remove "s.Click(slogo)" from the code, then it is working fine. But I need to click and confirm the image.
Screen s = new Screen();
Pattern slogo = new Pattern("C:\\Logo\\Logo.jpg");
s.Click(slogo);
This is the package details
enter image description here
I want to check the exact image only loaded or not.
I have a WCF service and I created its client using "Add WCF Service Reference" it has a custom SSL client certificate and I added it to client. It works on my own computer but when I move it to my server it doesn't work.
The code is a very simple function call like this:
using ConsoleAppFramework.MyServiceReference;
using System;
using System.Security.Cryptography.X509Certificates;
using System.ServiceModel.Security;
using System.Threading.Tasks;
namespace ConsoleAppFramework
{
internal class Program
{
static async Task Main(string[] args)
{
SoapServicesClient client = new SoapServicesClient();
client.ClientCredentials.ClientCertificate.Certificate = new X509Certificate2(#"C:\My-Client-Cert.p12", "pass");
client.ClientCredentials.ServiceCertificate.SslCertificateAuthentication = new X509ServiceCertificateAuthentication()
{
CertificateValidationMode = X509CertificateValidationMode.None,
RevocationMode = X509RevocationMode.NoCheck
};
client.Open();
var res = await client.loginStaticAsync(Array.Empty<contextEntry>(), new userInfoRequestBean()
{
username = "user",
password = "pass"
});
client.Close();
Console.WriteLine(res.#return.sessionId);
}
}
}
When I use .NET Framework 4.7.2 it work perfectly and I get the result but with .NET 6 I get this error:
Unhandled exception. System.ServiceModel.CommunicationException: An error occurred while sending the request.
---> System.Net.Http.HttpRequestException: An error occurred while sending the request.
---> System.IO.IOException: Unable to read data from the transport connection: An established connection was aborted by the software in your host machine..
---> System.Net.Sockets.SocketException (10053): An established connection was aborted by the software in your host machine.
--- End of inner exception stack trace ---
at System.Net.Security.SslStream.<FillBufferAsync>g__InternalFillBufferAsync|215_0[TReadAdapter](TReadAdapter adap, ValueTask`1 task, Int32 min, Int32 initial)
at System.Net.Security.SslStream.ReadAsyncInternal[TReadAdapter](TReadAdapter adapter, Memory`1 buffer)
at System.Net.Http.HttpConnection.FillAsync()
at System.Net.Http.HttpConnection.ReadNextResponseHeaderLineAsync(Boolean foldedHeadersAllowed)
at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.AuthenticationHelper.SendWithNtAuthAsync(HttpRequestMessage request, Uri authUri, ICredentials credentials, Boolean isProxyAuth, HttpConnection connection, HttpConnectionPool connectionPool, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.SendWithNtConnectionAuthAsync(HttpConnection connection, HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.AuthenticationHelper.SendWithAuthAsync(HttpRequestMessage request, Uri authUri, ICredentials credentials, Boolean preAuthenticate, Boolean isProxyAuth, Boolean doRequestAuth, HttpConnectionPool pool, CancellationToken cancellationToken)
at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpClientRequestChannel.HttpClientChannelAsyncRequest.SendRequestAsync(Message message, TimeoutHelper timeoutHelper)
--- End of inner exception stack trace ---
at ConsoleAppCore3_1.Program.Main(String[] args) in C:\Users\......\Program.cs:line 45
at ConsoleAppCore3_1.Program.<Main>(String[] args)
Is there anything changed between WCF client service on .NET Framework 4.7.2 and .NET 6?
What I tried
I try this with .NET Core 3.1 and I get the same error, only with .NET Framework I can get it to work.
The server is a Windows Server 2019, the code works on my computer with .NET 6 and .NET Core 3.1 but on my server these two versions throw the same error.
It has to do something that is closing your active http connection.
try this :
_client.DefaultRequestHeaders.ConnectionClose = true;
or you can use fiddler to further investigate what is happening.
After moving from the.NET Framework to the.NET Core, not all features are available. You can try using CoreWCF instead of the original functionality, see this article for more information.
At port "81", i have automation anywhere control room and want to make a api call to get authentication token.I tried below code locally its working fine but when i deploy in azure app service getting error
using (HttpClient httpClient = new HttpClient())
{
var authenticateClient = new RestClient("ipaddress:81/v1/authentication");
var authenticateRequest = new RestRequest(Method.POST);
authenticateRequest.AddHeader("Content-Type", AAConstant.fileFormat);
authenticateRequest.Parameters.Clear();
authenticateRequest.AddJsonBody(new
{
username = "******",
password = "*******"
});
IRestResponse authenticateResponse = authenticateClient.Execute(authenticateRequest);
StackTrace :
System.Net.WebException: An attempt was made to access a socket in a way forbidden by its access permissions An attempt was made to access a socket in a way forbidden by its access permissions ---> System.Net.Http.HttpRequestException: An attempt was made to access a socket in a way forbidden by its access permissions ---> System.Net.Sockets.SocketException: An attempt was made to access a socket in a way forbidden by its access permissions
at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
at System.Threading.Tasks.ValueTask`1.get_Result()
at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Threading.Tasks.ValueTask`1.get_Result()
at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask`1 creationTask)
at System.Threading.Tasks.ValueTask`1.get_Result()
at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
at System.Net.HttpWebRequest.SendRequest()
at System.Net.HttpWebRequest.GetResponse()
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.GetResponse()
at RestSharp.Http.GetRawResponse(HttpWebRequest request)
at RestSharp.Http.GetResponse(HttpWebRequest request)
Changed azure app service plan and also disabled antivirus,firewall but did not work .
Any help !!
My application uses Azure storage blobs in order to download files from remote storage to the local machine.
How it works:
The machine getting a queue message with URL (signed URL) to Azure Storage blob.
The application sending GET to download the file. It's done with HttpClient.
Application logic continues from there.
This is how I downloading the file:
HttpRequestMessage msg = new HttpRequestMessage(HttpMethod.Get, signedUrl);
HttpClient.Timeout = TimeSpan.FromSeconds(120);
var response = await HttpClient.SendAsync(msg);
response.EnsureSuccessStatusCode();
I found that few times per day, I got exception:
System.Threading.Tasks.TaskCanceledException: The operation was canceled.
---> System.IO.IOException: Unable to read data from the transport connection: Operation canceled.
---> System.Net.Sockets.SocketException: Operation canceled
--- End of inner exception stack trace ---
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.GetResult(Int16 token)
at System.Net.Security.SslStreamInternal.g__InternalFillBufferAsync|38_0[TReadAdapter](TReadAdapter adap, ValueTask1 task, Int32 min, Int32 initial)
at System.Net.Security.SslStreamInternal.ReadAsyncInternal[TReadAdapter](TReadAdapter adapter, Memory1 buffer)
at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.SendWithNtConnectionAuthAsync(HttpConnection connection, HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
at Polly.Retry.AsyncRetryEngine.ImplementationAsync[TResult](Func3 action, Context context, CancellationToken cancellationToken, ExceptionPredicates shouldRetryExceptionPredicates, ResultPredicates1 shouldRetryResultPredicates, Func5 onRetryAsync, Int32 permittedRetryCount, IEnumerable1 sleepDurationsEnumerable, Func4 sleepDurationProvider, Boolean continueOnCapturedContext)
at Polly.AsyncPolicy1.ExecuteAsync(Func3 action, Context context, CancellationToken cancellationToken, Boolean continueOnCapturedContext)
At this point, I must clarify that this behavior is happening to ~0.1% of the URLs passed in the system.
I was suspecting that the problem is with the signed-URL. I found in all cases the signed URL was correct - I just put it in the browser and it was working.
Now when I know that the problem is not the URL itself, I thought it can be a network problem. So, by using Polly I have added 5 retries with an exponential delay between each one. Up to 5 retries. Delay formula - 3^n (where n is the number of retries). In the worst case, it will wait 4 minutes before trying again... And even now - still same error. All 5 retries were used but the file was not downloaded.
What to do? What else I should check?
Seems to be a network issue. I suggest you use Azure Storage Client SDK to download blob.
// Blob SAS URL
string url = "https://storagetest789.blob.core.windows.net/devops/deploy.ps1?sp=r&st=2020-01-21T09:39:06Z&se=2020-01-21T17:39:06Z&spr=https&sv=2019-02-02&sr=b&sig=tyGX6wpgAooOZK2Po2ntukF0fGx3PosSNTgkLlVysrE%3D";
CloudBlockBlob blob = new CloudBlockBlob(new Uri(url));
Console.WriteLine(blob.DownloadText());
You can also download to file or stream with SDK methods. The SDK may handle all the underlying stuffs.
I have an Integration project, where my RestAPI's call WCF services of other project to do some CRUD operations.
My project is built on .net core 2.2.102. I deployed my project in BETA environment(PROD in my case) and pointed to the PROD URL's of the WCF services. Then I get this error while trying to run a request from my application :
The SSL connection could not be established, see inner exception.
I tried to reproduce it on my local. but it is working fine from my local machine when I am pointing to the BETA URLS of the WCF services.
I checked the firewall settings. I can see those are fine.
What could be the possible root cause for this? I dont have access to BETA so I cannot deploy with trial and error methods. I am attaching the Inner exception stack trace.
2019-02-04 15:03:50.752 -06:00 [Error] - HTTP Request "GET" in ms
System.ServiceModel.CommunicationException: The SSL connection could not be established, see inner exception. ---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
--- End of inner exception stack trace ---
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.GetResult(Int16 token)
at System.Net.FixedSizeReader.ReadPacketAsync(Stream transport, AsyncProtocolRequest request)
at System.Net.Security.SslState.ThrowIfExceptional()
at System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult)
at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result)
at System.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult)
at System.Net.Security.SslStream.<>c.<AuthenticateAsClientAsync>b__47_1(IAsyncResult iar)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)
at System.Threading.Tasks.ValueTask`1.get_Result()
at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Threading.Tasks.ValueTask`1.get_Result()
at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask`1 creationTask)
at System.Threading.Tasks.ValueTask`1.get_Result()
at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.AuthenticationHelper.SendWithAuthAsync(HttpRequestMessage request, Uri authUri, ICredentials credentials, Boolean preAuthenticate, Boolean isProxyAuth, Boolean doRequestAuth, HttpConnectionPool pool, CancellationToken cancellationToken)
at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpClientRequestChannel.HttpClientChannelAsyncRequest.SendRequestAsync(Message message, TimeoutHelper timeoutHelper)
--- End of inner exception stack trace ---
at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
at System.ServiceModel.Channels.ServiceChannelProxy.TaskCreator.<>c__DisplayClass1_0.<CreateGenericTask>b__0(IAsyncResult asyncResult)
--- End of stack trace from previous location where exception was thrown ---
at UAL.ATW.External.EzCare.EzCareWcfClient.ExecuteWcfServiceCall[TClient,TResult](TClient client, Func`2 execute) in *********************EzCareWcfClient.cs:line 42
at UAL.ATW.External.EzCare.EzCareWcfClient.Execute[TResult](String operationUniqueId, Func`1 functionToExecute) in *****************************\EzCareWcfClient.cs:line 31
at UAL.ATW.External.EzCare.EzCareManager.GetCompensationsIssuedByAgentIdAsync(AgentID agentId) in *****************EzCareManager.cs:line 48
at UAL.ATW.Compensation.CompensationsFacade.GetCompensationsIssuedByAgentIdAsync(AgentID agentId) in **************************\CompensationsFacade.cs:line 117
at UAL.ATW.Services.ITMC.Host.Controllers.CompensationsController.GetCompensationsIssuedByAgentId(String agentId) in ****************************\Controllers\CompensationsController.cs:line 36
at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()
at Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at
dotnet dev-certs https --trust
This should pop a dialog asking you if you want to add the cert to your trusted store, which you obviously should accept. You'll need to do this for each project. For example, it's not enough to trust your web app, if that web app is connecting to an API app. You need to do the same thing for the API app so that both certs are trusted.