Visual Studio not debugging while debugging unit tests?

I have a bunch of unit test I test, and I put a breakpoint on the unitest code, and when I start with CTL+R,T instead of stopping at the breakpoint, it just executes the code and I try to debug the unittest code because its failing. .. any help?

I am using the professional version of VS 2010

+8
source share
4 answers

I highly recommend Test Driven , you can right-click the test and select the test using the debugger and easily execute the code.

0
source

Visual Studio 2010 test not included in debugger on exception

Make sure you run "Test-> Debug" or "Debug test" / "Debug test selected". Simply running tests with configuration on Debug will not attach the debugger to the current test.

'Hope that helps

+8
source

I had the same problem and solved it like this:

  • right click on the test project
  • go to properties
  • open the "build" tab.
  • uncheck the box next to "Optimize code."
+2
source

The same problem arose with me in Visual Studio 2015. The problem was that the " Solution Configuration " drop-down list in the Visual Studio toolbar was not set to "Debug". After making the changes, the debugging worked.

0
source

All Articles