使用Azure管理API列出容器组失败,出现System.Net.Sockets.SocketException



我正在使用一些Azure管理nuget包,例如.NET的Azure容器实例库数月。

几天前,我在尝试做一些简单的事情时注意到了一些错误,比如获取容器实例的列表,例如:

using Microsoft.Azure.Management.ContainerInstance.Fluent;
using Microsoft.Azure.Management.ContainerInstance.Models;
using Microsoft.Azure.Management.Fluent;
using Microsoft.Azure.Management.ResourceManager.Fluent.Core;
var groups = await _azure.ContainerGroups.ListAsync(loadAllPages: true);

错误消息如下:

操作已取消。无法从传输连接读取数据:由于线程退出或应用程序请求,I/O操作已中止。由于线程退出或应用程序请求,I/O操作已中止

此代码正在Azure函数上执行,但当我在计算机上运行它时,也会发生相同的错误

在Azure函数上运行代码时,异常的堆栈跟踪如下:

System.Threading.Tasks.TaskCanceledException:位于Microsoft.Rest.RetryDelegatingHandler+d__15.MoveNext(Microsoft.Rest.ClientRuntime,版本=2.0.0.0,Culture=neutral,PublicKeyToken=31bf3856a364e35)位于System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter1.GetResult(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)位于Microsoft.Azure.Management.ResourceManager.Fluent.Core.ProviderRegistrationDelegatingHandler+d_4.MoveNext(Microsoft.Azure_Management.RResourceManager.Fluent,版本=1.0.0.61,文化=中性,PublicKeyToken=31bf3856ad364e35)位于System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter1.GetResult(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)位于Microsoft.Azure.Management.ResourceManager.Fluent.Core.HttpLoggingDelegatingHandler+d__7.MoveNext(Microsoft.Azure_Management.RresourceManager.Fluent,版本=1.0.0.61,Culture=neutral,PublicKeyToken=31bf3856a364e35)位于System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter1.GetResult(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)位于Microsoft.Azure.Management.ResourceManager.Fluent.Core.UserAgentDelegatingHandler+d_5.MoveNext(Microsoft.Azure_Management.RresourceManager.Fluent,版本=1.0.0.61,Culture=neutral,PublicKeyToken=31bf3856a364e35)位于System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)在System.Runtime.CompilerServices.ConfiguredTaskAwaitable1+ConfiguredTaskAwaiter.GetResult(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)位于System.Net.Http.HttpClient+d__62.MoveNext(System.Net.HHttp,版本=4.2.1.0,区域性=中性,PublicKeyToken=b03f5f7f11d50a3a)位于System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)在System.Runtime.CompilerServices.ConfiguredTaskAwaitable1+ConfiguredTaskAwaiter.GetResult(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)位于Microsoft.Azure.Management.ContainerInstance.Fluent.ContainerCGroupsOperations+d__7.MoveNext(Microsoft.Azure_Management.ContentainerInstance.Fluent,版本=1.0.0.61,Culture=neutral,PublicKeyToken=31bf3856a364e35)位于System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)在System.Runtime.CompilerServices.ConfiguredTaskAwaitable1+ConfiguredTaskAwaiter.GetResult(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)位于Microsoft.Azure.Management.ContainerInstance.Fluent.ContainerCGroupsOperationsExtensions+d_2.MoveNext(Microsoft.Azure_Management.ContentainerInstance.Fluent,版本=1.0.0.61,Culture=neutral,PublicKeyToken=31bf3856a364e35)位于System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter1.GetResult(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)位于Microsoft.Azure.Management.ResourceManager.Fluent.Core.ResourfaceActions.IndexebleRefreshableWrapper2+d__8.MoveNext(Microsoft.Azure_Management.RResourceManager.Fluent,版本=1.0.0.61,Culture=neutral,PublicKeyToken=31bf3856a364e35)位于System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter1.GetResult(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)位于Microsoft.Azure.Management.ContainerInstance.Fluent.ContainerCGroupImpl+d__37.MoveNext(Microsoft.Azure_Management.ContentainerInstance.Fluent,版本=1.0.0.61,Culture=neutral,PublicKeyToken=31bf3856a364e35)位于System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter1.GetResult(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)位于Microsoft.Azure.Management.ContainerInstance.Fluent.ContainerCGroupsImpl+d__21.MoveNext(Microsoft.Azure_Management.ContentainerInstance.Fluent,版本=1.0.0.61,Culture=neutral,PublicKeyToken=31bf3856a364e35)位于System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter1.GetResult(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)位于Microsoft.Azure.Management.ResourceManager.Fluent.Core.PagedCollection2+<>c_DisplayClass21_0+<b__0>d.MoveNext(Microsoft.Azure.Management.ResourceManager.Fluent,版本=1.0.0.61,Culture=neutral,PublicKeyToken=31bf3856a364e35)位于System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter1.GetResult(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)位于Microsoft.Azure.Management.ResourceManager.Fluent.Core.PagedCollection2+d__21.MoveNext(Microsoft.Azure_Management.RourceManager.Fluent,版本=1.0.0.61,Culture=neutral,PublicKeyToken=31bf3856a364e35)位于System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.GetResult(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)位于Microsoft.Azure.Management.ResourceManager.Fluent.Core.PagedCollection2+d__16.MoveNext(Microsoft.Azure_Management.RourceManager.Fluent,版本=1.0.0.61,Culture=neutral,PublicKeyToken=31bf3856a364e35)位于System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter1.GetResult(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)位于Microsoft.Azure.Management.ContainerInstance.Fluent.ContainerCGroupsImpl+d__20.MoveNext(Microsoft.Azure_Management.ContentainerInstance.Fluent,版本=1.0.0.61,Culture=neutral,PublicKeyToken=31bf3856a364e35)位于System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)在Polly.Retry.AsyncRetryEngine+d__01.MoveNext(Polly,版本=7.0.0.0,区域性=中性,PublicKeyToken=c8a3fc3f8f825cc)位于System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)在Polly.AncPolicy+d__211.MoveNext(Polly,版本=7.0.0.0,区域性=中性,PublicKeyToken=c8a3fc3f8f825cc)位于System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter1.GetResult(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)位于Pyra.Automation.BuildAgents.Monitor.Command.CreateBuildAgentInstanceCommand+d__8.MoveNext(Pyra.Automation.BuildAgents.Monitor,Version=1.0.0.0,Culture=neutral,PublicKeyToken=nullPyra.AAutomation.BuildAgents.Monitor,Version=1.0.0,Culture=neutral、PublicKeyToken=null:F:\Agent02\w\961\src\Pyra.Antomation.BuildAgents.Monitor\Command\CreateBuildAgentInstanceCommand.csPyra.Automation.BuildAgent.Monitor,Version=1.0.0.0,Culture=neutrale,PublicKeyToken=null:128)位于System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)在系统中。运行时。编译器服务。任务等待者。ThrowForNonSuccess(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)在系统中。运行时。编译器服务。任务等待者。HandleNonSuccessAndDebuggerNotification(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)在系统中。运行时。编译器服务。TaskAwaiter1.GetResult(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)在Pyra。自动化建筑代理。班长命令。CreateBuildAgentInstanceCommand+d__7.MoveNext(Pyra.Automation.BuildAgents.Monitor,Version=1.0.0.0,Culture=neutral,PublicKeyToken=nullPyra.AAutomation.BuildAgents.Monitor,Version=1.0.0,Culture=neutral、PublicKeyToken=null:F:\Agent02\w\961\src\Pyra.Antomation.BuildAgents.Monitor\Command\CreateBuildAgentInstanceCommand.csPyra.Automation.BuildAgent.Monitor,Version=1.0.0.0,Culture=neutrale,PublicKeyToken=null:78)在系统中。运行时。例外服务。ExceptionDispatchInfo。Throw(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)在系统中。运行时。编译器服务。任务等待者。ThrowForNonSuccess(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)在系统中。运行时。编译器服务。任务等待者。HandleNonSuccessAndDebuggerNotification(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)在系统中。运行时。编译器服务。TaskAwaiter1.GetResult(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)在Pyra。自动化建筑代理。班长作用BuildAgentSchedulerFunction+d__1.MoveNext(Pyra.Automation.BuildAgents.Monitor.Function,Version=1.0.0.0,Culture=neutral,PublicKeyToken=nullPyra.AAutomation.BuildAgents.Monitor,Version=1.0.0,Culture=neutral。PublicKeyToken=null:F:\Agent02\w\961\src\Pira.Automation\BuildAgentSchedulerFunction.csPyra.Automation.BuildAgents.Monitor_Function,Version=1.0.0.089)在系统中。运行时。例外服务。ExceptionDispatchInfo。Throw(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)在系统中。运行时。编译器服务。任务等待者。ThrowForNonSuccess(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)在系统中。运行时。编译器服务。任务等待者。HandleNonSuccessAndDebuggerNotification(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)在系统中。运行时。编译器服务。任务等待者。GetResult(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)在Pyra。自动化建筑代理。班长作用BuildAgentSchedulerFunction+d__0.MoveNext(Pyra.Automation.BuildAgents.Monitor.Function,Version=1.0.0.0,Culture=neutral,PublicKeyToken=nullPyra.AAutomation.BuildAgents.Monitor,Version=1.0.0,Culture=neutral。PublicKeyToken=null:F:\Agent02\w\961\src\Pira.Automation\BuildAgentSchedulerFunction.csPyra.Automation.BuildAgents.Monitor_Function,Version=1.0.0.050)内部异常系统。IO.IO在Microsoft处理异常。Rest.RetryDelegatingHandler+d__15.移动下一步:在系统中。网插座。Socket+等待SocketAsyncEventArgs。ThrowException(System.Net.Sockets,版本=4.2.1.0,区域性=中性,PublicKeyToken=b03f5f7f11d50a3a)在系统中。网插座。Socket+等待SocketAsyncEventArgs。GetResult(System.Net.Sockets,版本=4.2.1.0,区域性=中性,PublicKeyToken=b03f5f7f11d50a3a)在系统中。运行时。编译器服务。ConfiguredValueTaskAwaitable1+ConfiguredValueTaskAwaiter。GetResult(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)在系统中。网安全SslStreamInternal+<g_InternalFillBufferAsync|38_0>d1.MoveNext(System.Net.Security,版本=4.1.1.0,区域性=中性,PublicKeyToken=b03f5f7f11d50a3a)在系统中。运行时。例外服务。ExceptionDispatchInfo。Throw(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)在系统中。运行时。编译器服务。任务等待者。ThrowForNonSuccess(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)在系统中。运行时。编译器服务。任务等待者。HandleNonSuccessAndDebuggerNotification(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)在系统中。运行时。编译器服务。ConfiguredValueTaskAwaitable1+ConfiguredValueTaskAwaiter。GetResult(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)在系统中。网安全SslStreamInternal+d__341.MoveNext(System.Net.Security,版本=4.1.1.0,区域性=中性,PublicKeyToken=b03f5f7f11d50a3a)位于System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=7cec85d7bea7798e)在System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable1+ConfiguredValueTaskAwaiter.GetResult(System.Private.CoreLib,版本=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e)位于System.Net.Http.HttpConnection+d__61MoveNext(System.Net.HHttp,版本=4.2.1.0,区域性=中性,PublicKeyToken=b03f5f7f11d50a3a)在System.Net.Sockets.Socket+AwaitableSocketAsyncEventArgs.ThrowException处处理的内部异常System.Net.Sackets.SocktException:

我试图更新nuget包以使用可用的最新版本,但出现了相同的错误,我缺少什么?

我再也无法重现这个问题了,但无论如何我都会发布答案,希望它能帮助有类似问题的人。

我认为这个问题是由一些混乱的容器实例引起的

几个月前,我遇到了一个类似的问题——我无法在Azure门户中看到一些容器组的状态,只有一个-(短划线)。删除这些容器后,一切都按预期进行。

结论:

  • 如果列出的容器实例停止工作,请转到Azure门户并检查状态为FailedTerminated-等的容器。删除这些组并尝试再次列出容器

在我看来,代码抛出了一个内部错误,但你没有收到:

异步void方法具有不同的错误处理语义。当异步Task或异步Task方法抛出异常时,会捕获该异常并将其放置在Task对象上。对于异步void方法,没有Task对象,因此从异步void方法抛出的任何异常都将直接在异步void方法启动时处于活动状态的SynchronizationContext上引发。

看看你的方法是否返回任务:

public static async Task UseMethodWithAsyncVoid()
{
try
{
await MethodWithException();
}
catch (Exception e)
{
Console.WriteLine("Ex Message" + e.Message);
}
}

相关内容

  • 没有找到相关文章

最新更新