如何跟踪引发异常的行 [英] How to track which line raising the exception

查看:61
本文介绍了如何跟踪引发异常的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




专家



try

  {

//此代码块

第1行

第2行

第3行

etc

}


捕捉 Exception
ex)

  {

  LblError.Text = ex.Message + ex.InnerException。消息

}

推荐答案

嘿那里, 

Hey there, 

你所要做的就是运行代码,然后在VS windows的底部若要"输出",只需选择"错误列表"标签,并且应该有一个"行"列,您可以在其中找到导致错误/异常的确切行。

All you have to do is run the code and at the bottom of the VS windows next to "output", just select the "Error List" tab, and there should be a "Line" column from where you can pintpoint the exact line that caused the Error/Exception.


这篇关于如何跟踪引发异常的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆