Visual Studio 2019远程调试器未中断异常

我有一个正在调试的.NETCore 3 Blazor项目。在远程调试器的“输出”窗口和chrome控制台中都会显示抛出的异常。但是,无论我更改了什么配置,VS都拒绝打破这些例外。

我遵循了this帖子中的建议:

  • 在“工具”>“选项”>“调试”下选中“仅启用我的代码”
  • 禁用“未处理用户代码时继续”标志

由于我有一个全局异常处理程序(请参阅ASP.NET顶级异常处理程序上的note

  • “要恢复VS在未处理的异常上中断的行为,我必须勾选要中断的所有异常类型,然后确保“其他选项”(您可能需要使此列可见* )中未设置“未处理用户代码时继续”(x

我的配置:

Visual Studio 2019远程调试器未中断异常

Visual Studio 2019远程调试器未中断异常

在输出窗口中打印的异常(例如,抛出的其他异常也不会中断):

System.InvalidOperationException: This instance has already started one or more requests. Properties can only be modified before sending the first request.
   at System.Net.Http.HttpClient.CheckDisposedOrStarted()
   at System.Net.Http.HttpClient.set_Timeout(TimeSpan value)
   at [...].Web.Client.Pages.DiagnosticsBase.Createmio() in C:\[...]\Diagnostics.razor.cs:line 94
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__139_0(Object state)
   at microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.ExecuteSynchronously(TaskCompletionSource`1 completion,SendOrPostCallback d,Object state)
   at microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.<>c.<.cctor>b__23_0(Object state)
   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.ExecutionContext.Run(ExecutionContext executionContext,Object state)
   at microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.ExecuteBackground(WorkItem item)

在Chrome控制台中打印的异常:

Visual Studio 2019远程调试器未中断异常

我还进行了检查,以确保System.InvalidOperationException被检查为在抛出时中断,没有任何条件或采取其他措施:

Visual Studio 2019远程调试器未中断异常

在远程调试会话期间,断点似乎工作正常。我正在远程调试与在远程服务器上运行的相同版本的代码,并且服务器正在运行在Debug配置中构建的代码。

我在这里做错了什么?我很困惑,我觉得我在很大程度上必须误解了设置,因为我找不到调试器没有中断的原因。

fzamcy 回答:Visual Studio 2019远程调试器未中断异常

我有同样的问题。

您是否尝试过在调试设置中关闭“仅我的代码”选项,以便查看框架中是否出现了异常?

本文链接:https://www.f2er.com/3152413.html

大家都在问