Debugger variable $exception

If your catch block do nothing with caught exception you may declare block argument without name (to avoid warning message "CS0168: The variable 'ex' is declared but never used"):

    try

    {

        ...

    }

    catch (Exception)

    {

        // deliberately suppressing all exceptions

    }

But one day during debugging you may actually want to examine Exception. Since you don't have variable where exception is stored you can use debugger variable $exception provided by the Visual Studio.NET 2005 Debugger to examine the exception in a catch block. Just add it to Watch Window.

转载于:https://www.cnblogs.com/josephshi/archive/2008/01/15/1039910.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在Visual Studio.NET 2005 Debugger中,可以使用调试器变量$exception来检查catch块中的异常。只需将其添加到Watch Window中即可。通过使用调试器变量$exception,您可以在调试过程中查看异常的详细信息。 另外,在Debug过程中,如果您想停止Debug并且不执行后续流程,同时又不想删除数据库数据,您可以直接关闭程序。这样就能够终止Debug,并且保留数据库数据。 在Visual Studio的Debug模式下,还有一些其他的功能和窗口可以帮助您进行调试。例如,可以设置断点来指示程序运行到特定位置时停止执行。同时,调试窗口可以显示方法调用栈、变量和观察表达式,以帮助您分析和排查问题。 总结起来,调试器的变量在Visual Studio.NET 2005 Debugger中被称为$exception,它可以用于检查异常。同时,通过设置断点、使用调试窗口中的方法调用栈、变量和观察表达式等功能,您可以更好地进行调试和问题排查。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [Debugger variable $exception](https://blog.csdn.net/weixin_30475039/article/details/99332814)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* *3* [IDEA 2020 Debug 调试详细使用笔记](https://blog.csdn.net/GUYyyy/article/details/115268162)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值