Resharper NUnit Test Runner不打破未处理的异常

时间:2016-02-15 13:02:03

标签: visual-studio-2015 nunit resharper breakpoints visual-studio-debugging

当我在调试模式下运行nunit测试时(在Resharper中 Ctrl-u d ),并且发生了一些未处理的异常,调试器不会中断并跳转到代码中的错误。相反,输出窗口充满了错误,如

Exception thrown: 'NUnit.Framework.AssertionException' in nunit.framework.dll 
  //              ^^^^^^^ This is the actual exception that I want to break on.
  // Can be any exception inside my test method, e.g. also a null reference exception.
Exception thrown: 'System.Reflection.TargetInvocationException' in mscorlib.dll
Exception thrown: 'NUnit.Core.NUnitException' in nunit.core.dll
The thread 'NUnit Reporter' (0x37f4) has exited with code 0 (0x0).
Exception thrown: 'System.UnauthorizedAccessException' in mscorlib.dll
Exception thrown: 'System.UnauthorizedAccessException' in mscorlib.dll
Exception thrown: 'System.UnauthorizedAccessException' in mscorlib.dll
Exception thrown: 'System.UnauthorizedAccessException' in mscorlib.dll
Exception thrown: 'System.UnauthorizedAccessException' in mscorlib.dll
Exception thrown: 'System.UnauthorizedAccessException' in mscorlib.dll
Exception thrown: 'System.UnauthorizedAccessException' in mscorlib.dll
Exception thrown: 'System.UnauthorizedAccessException' in mscorlib.dll
Exception thrown: 'System.UnauthorizedAccessException' in mscorlib.dll
Exception thrown: 'System.UnauthorizedAccessException' in mscorlib.dll
Exception thrown: 'System.UnauthorizedAccessException' in mscorlib.dll
Exception thrown: 'System.UnauthorizedAccessException' in mscorlib.dll
Exception thrown: 'System.UnauthorizedAccessException' in mscorlib.dll
Exception thrown: 'System.UnauthorizedAccessException' in mscorlib.dll
Exception thrown: 'System.UnauthorizedAccessException' in mscorlib.dll
Exception thrown: 'System.UnauthorizedAccessException' in mscorlib.dll
Exception thrown: 'System.UnauthorizedAccessException' in mscorlib.dll
Exception thrown: 'System.UnauthorizedAccessException' in mscorlib.dll
Exception thrown: 'System.UnauthorizedAccessException' in mscorlib.dll
Exception thrown: 'System.UnauthorizedAccessException' in mscorlib.dll
Exception thrown: 'System.UnauthorizedAccessException' in mscorlib.dll
Exception thrown: 'System.UnauthorizedAccessException' in mscorlib.dll
The thread 'Runner thread' (0x33b8) has exited with code 0 (0x0).
Exception thrown: 'System.IO.EndOfStreamException' in JetBrains.ReSharper.TaskRunnerFramework.dll
The program '[10008] JetBrains.ReSharper.TaskRunner.CLR45.exe: Managed (v4.0.30319)' has exited with code 0 (0x0).

当我在某处放置断点时,调试器会正确地断开并跳转。当我检查异常设置中的所有CLR异常时,调试器确实会中断,但它也会中断处理的异常,这是我不想要的,并且上面发布的错误仍然会发生。

这里出了什么问题?

更新

启用 Just My Code 时,错误列表会缩减为

Exception thrown: 'NUnit.Framework.AssertionException' in nunit.framework.dll
An exception of type 'NUnit.Framework.AssertionException' occurred in nunit.framework.dll but was not handled in user code
The thread 'NUnit Reporter' (0x5288) has exited with code 0 (0x0).
The thread 'Runner thread' (0x61ec) has exited with code 0 (0x0).
The program '[22972] JetBrains.ReSharper.TaskRunner.CLR45.exe: Managed (v4.0.30319)' has exited with code 0 (0x0).

但异常仍然没有破损。

0 个答案:

没有答案
相关问题