when I made an unit test and there is an exception as below, can any one tell me what's wrong with this:
An exception of type 'Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException' occurred in Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll but was not handled in user code
I had this problem in Visual Studio 2012. Here's how I fixed it:
In the exception pop up, I had a checked box next to "Break when this type of exception isn't user-handled."
I unchecked the box.
Sometimes it's the simple things that get you. :)
Update 1 year later :)
So this doesn't pertain to this particular question, but I learned another trick to hide exceptions that are thrown by non-Microsoft .dll's. (Assert.Failed is inside one of the System libraries, so the OP wouldn't need to use this trick.)
You may have noticed that some exceptions mysteriously continue to break when unhandled, even when you uncheck the "Break when this exception type is thrown" box.
There is a reason for this! Visual Studio doesn't know how to recognize that Exception type.
Here's how to teach it a new trick:
Once you've added your exception, you'll also be able to use the "Break when this exception is thrown" checkbox in the popup again.
Happy coding!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With