在调试模式下抛出异常

在调试模式下抛出异常

本文介绍了在调试模式下抛出异常,但在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

mscorlib.ni.dll 中发生类型为System.IO.IsolatedStorage.IsolatedStorageException"的第一次机会异常不允许对 IndependentStorageFileStream 进行操作.

它向我展示了这个通知,但我不知道它是从哪里生成的.如何找出产生此异常的代码在哪里?

附注.

我正在使用调试模式.(C#)

解决方案

这是第一次机会异常,即有一个 try-catch 块来处理它.默认情况下,Visual Studio 不会因第一次异常而中断.

要在引发异常时使 Visual Studio 中断,请执行以下操作:

  • 打开调试"菜单并单击例外..."
  • 选中抛出"列中所需例外的复选框.
  • 点击确定

此后,Visual Studio 调试器将始终在抛出该特定异常时中断.要返回原始行为,请清除抛出"列中的复选框.

It shows me this notice, but I don't know where does it generate it. How find out where is the code which generates this exception?

PS.

I'm using debug mode. (C#)

解决方案

This is a first-chance exception, i.e. one that has a try-catch block that will take care of it. By default, Visual Studio doesn't break on first-chance exceptions.

To make Visual Studio break when that exception is thrown do the following:

  • Open the "Debug" menu and click "Exceptions..."
  • Select the checkbox in the "Thrown" column for the exception you want.
  • Click OK

Henceforth, the Visual Studio debugger will always break on that particular exception, whenever it's thrown. To go back to the original behavior, clear the checkbox in the "Thrown" column.

这篇关于在调试模式下抛出异常,但在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 23:47