[nunit-discuss] VS 2010 not loading symbols when attaching to NUnit

1,268 views
Skip to first unread message

daveh551

unread,
Apr 19, 2010, 1:39:41 PM4/19/10
to NUnit-Discuss
I just read the thread about debugging under VS 2010, thinking it
would answer my question, but that appears to be a different issue.

Under VS 2008, I would run my tests under NUnit, and, if I needed to
debug, I would attach the VS2008 debugger to the running Nunit process
(Debug -> Attach to Process), and set any breakpoints on code I wanted
to examine. When I hit the Run buttion in NUnit, it would hit the
breakpoint. (BTW, if it matters, this was running NUnit 2.5.2).

I just upgraded to NUnit 2.5.4 and VS 2010. When I set a breakpoint,
then attach to NUnit, I get a little warning symbol on the breakpoint
dot, and hovering over it gives the tooltip "Breakpoint will not be
hit. No symbols are currently loaded". Going to the Debug -> Windows -
> Modules window shows a whole bunch of Windows and NUnit modules
loaded, with the Symbol Status of "Skipped loading symbols", and then
1 module with a funny name that changes each time (r1euhmh5 right
now), and Symbol Status of "No symbols loaded".

Right clicking that filename (assuming that to be some mapping from my
DLL under test), and clicking Load Symbols From -> Symbol Path, and
navigating to the bin\debug folder, then clicking the pdb file of my
DLL under test, I get the message "A matching symbol was not found in
this folder". (The top of the Open dialog box has a line that says
"Original location: r1euhmh5.pdb")

So what's changed? And how do I go about debugging/breakpointing
under VS 2010/NUnit 2.5.4 (Or is it possible I screwed something up
when I decided to go through my VS2010 options and set some of them to
more advanced levels than I knew what I was doing?)

I appreciate any help.

--
You received this message because you are subscribed to the Google Groups "NUnit-Discuss" group.
To post to this group, send email to nunit-...@googlegroups.com.
To unsubscribe from this group, send email to nunit-discus...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nunit-discuss?hl=en.

Charlie Poole

unread,
Apr 19, 2010, 3:04:20 PM4/19/10
to nunit-...@googlegroups.com
I'm taking a guess here...

My guess is that NUnit is running under .NET 2.0, with tests under .NET 4.0.
You can confirm this by using the Tools | Test Assemblies... menu item
after the tests have loaded.

If that's the case, you need to attach to nunit-agent.exe, not to nunit.exe.

Charlie

daveh551

unread,
Apr 19, 2010, 4:16:24 PM4/19/10
to NUnit-Discuss
.... or the other way around? NUnit Tools -> Test Assemblies says that
nunit.exe is running CLR Version 4,

and the test DLL has an image runtime version 2.0.

At any rate, attaching to nunit-agent.exe instead of nunit.exe did the
trick.

Thanks for your help.
> > For more options, visit this group athttp://groups.google.com/group/nunit-discuss?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups "NUnit-Discuss" group.
> To post to this group, send email to nunit-...@googlegroups.com.
> To unsubscribe from this group, send email to nunit-discus...@googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/nunit-discuss?hl=en.

Charlie Poole

unread,
Apr 19, 2010, 4:33:06 PM4/19/10
to nunit-...@googlegroups.com
Indeed, the other way around would do it as well. :-)

This seems like a good reason we should default to running in a separate
process: it would make it more obvious where to attach for debugging.

Charlie
Reply all
Reply to author
Forward
0 new messages