为什么有时会忽略trycatch?
c#
一个例子是这个代码:
try
{
string domain = o.SelectToken("response[" + i + "].domain").ToString();
...
}
catch(Exception)
{
continue;
}
vs 停止并指向string domain = o.SelectToken("response[" + i + "].domain").ToString();for an ,而不是在循环中继续(“继续”)System.IndexOutOfRangeException。
这是为什么?
回答
您可能在 Debug>Windows>Exception 设置中选择了“中断所有异常”:
https://docs.microsoft.com/en-us/visualstudio/debugger/managing-exceptions-with-the-debugger?view=vs-2019
取消选择这将让 VS 继续。