簡體   English   中英

Program.cs 上的 Visual Studio 中斷不在引發異常的行上

[英]Visual Studio break on Program.cs not on the line that throws the exception

我有一個 C# 控制台應用程序。 Program.cs中,我調用各種服務。 如果其中一項服務引發Exception ,則 VS 在Program.cs中中斷,而不是在實際負責該錯誤的行上。 模態甚至不指示哪條線拋出。 我知道您仍然可以獲得跟蹤等,但通常 VS 在負責的線路上中斷,這使得調試更加容易。

如何讓 VS 打破“外部代碼”?

在此處輸入圖像描述

  1. 從 Debug > Windows > Exception Settings 打開異常設置

  2. 搜索您的異常名稱。

  3. 在您的異常之前選中復選框。

  4. 在 Debug > Options > Debugging > General 中取消選中Enable Just My Code

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM