Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't debug test using breakpoint in Visual Studio 2013

I'm trying to debug a failing unit test by putting a breakpoint at the beginning of the test method and choosing Debug Selected Tests in the Test Explorer. However, the test always runs (and fails) without hitting the breakpoint.

I've tried:

  • Cleaning and rebuilding the project
  • Restarting Visual Studio

This seems like a pretty basic case - I'm not attaching to a separate process, or doing anything fancy. Just a basic unit test inside VS2013. What else can I try to get the debugger to work correctly?

like image 370
Nate Barbettini Avatar asked Jan 31 '15 19:01

Nate Barbettini


1 Answers

This did indeed turn out to be simple. I had forgotten that I told Visual Studio not to build the test project (Build - Configuration Manager - unchecked Build). I was trying to speed up my compile times, and it came back to bite me.

Long but simple story short, Build Configuration is another thing you can check if you strangely can't debug code you've placed breakpoints on in the IDE.

like image 79
Nate Barbettini Avatar answered Sep 20 '22 00:09

Nate Barbettini