You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HttpClient httpClient = new HttpClient();
try
{
var s = httpClient.GetAsync("http://www.baidu.com").Result;
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
The Exception:
at System.Threading.Tasks.Task.RunContinuations(Object continuationObject)
at System.Threading.Tasks.Task`1.TrySetResult(TResult result)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetExistingTaskResult(Task`1 task, TResult result)
at System.Net.Http.HttpConnectionPool.HttpConnectionWaiter`1.WaitForConnectionAsync(Boolean async, CancellationToken requestCancellationToken)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.ExecutionContextCallback(Object s)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext()
at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining)
at System.Threading.Tasks.Task.RunContinuations(Object continuationObject)
at System.Threading.Tasks.Task`1.TrySetResult(TResult result)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetExistingTaskResult(Task`1 task, TResult result)
at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.ExecutionContextCallback(Object s)
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.ExecuteFromThreadPool(Thread threadPoolThread)
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
at System.Threading.Thread.StartCallback()
--- End of stack trace from previous location ---
When I haven't upgraded to macos 14.1,everything is ok,But when I upgraded to macos 14.1, all the HttpClient is error with the same exception 。
I create the new project,it‘s the same exception。
Please help me!
The text was updated successfully, but these errors were encountered:
//it's working.
var s = await httpClient.GetAsync("http://www.baidu.com");
//it's working.
var s1 = httpClient.GetAsync("http://localhost:8001/home/getenv").Result;
//it's report the exception
var s1 = httpClient.GetAsync("http://127.0.0.1:8001/home/getenv").Result;
Based on the above,I found the "localhost:8001" is ok, and the "127.0.0.1:8001" is not work.
operating system: macos 14.1 sonama
dotnet : 7.0.2
Error Code:
The Exception:
When I haven't upgraded to macos 14.1,everything is ok,But when I upgraded to macos 14.1, all the HttpClient is error with the same exception 。
I create the new project,it‘s the same exception。
Please help me!
The text was updated successfully, but these errors were encountered: