debugging nunit tests in visual studio 2010

Tue, Jun 19, 2012

If you’re trying to debug your NUnit tests in Visual Studio and getting the error:

The breakpoint will not currently be hit
this is how to sort it. First, change NUNIT_HOME\bin\nunit.exe.config to remove references to .NET2 and make sure .NET4 is enabled, e.g.

nunit1

then in NUnit itself, go to Tools -> Settings -> IDE Support -> Visual Studio and enable it:

nunit2

Start up NUnit but don’t run any tests. Go to Visual Studio and choose Debug -> Attach to Process:

nunit3

and choose the nunit.exe process:

nunit4

Set some breakpoints in the test you’re running and run it from NUnit and you’ll be able to debug the test.

Reference : Fixing “The breakpoint will not currently be hit. No symbols have been loaded for this document.”

comments powered by Disqus