How to disable first-chance exceptions when unit testing Windows Phone 7?
I've been trying to get up to speed with unit testing in Windows Phone 7, and I have a basic test harness working, but when running the tests with the debugger attached, an Assert
failure will cause VS to break 开发者_StackOverflowat the exception:
From what I've read, I should be able to stop this behavior by disabling first chance exceptions. I tried unchecking User-unhandled from the Common Language Runtime Exceptions on the Debug->Exceptions dialog, as described in this blog post. This post was about enabling first chance exceptions, but I expected doing the opposite would disable them.
I tried adding the specific exception names as described in this blog post, and that also did not work:
Other details:
- I'm using the Windows Phone SDK 7.1 Beta 2, published 6/29/2011
- I'm using the updated Silverlight Unit Testing binaries for the Mango beta
- I followed the first section of this cheat sheet to get the test harness running
I'm hoping that someone can point me in the right direction, or at least confirm that this does in fact work on their machine.
Ultimately, this isn't a big problem; I could start without debugging (CTRL+F5), and eventually, shouldn't hit this anyway since all the tests should pass, but it's annoying that I can't get it to run through without breaking into VS.
Have you tried this?
http://sgomez.blogspot.com/2009/12/how-to-disable-assert-dialogs-while.html
Add to your config file:
<system.diagnostics>
<assert assertuienabled="false"/>
</system.diagnostics>
精彩评论