VS 2010 调试器在附加到 NUnit 时不加载符号
(我刚刚在 groups.google.com 上的 NUnit 讨论组中发布了此内容)
在 VS 2008 下,我将在 NUnit 下运行我的测试,并且,如果我需要 调试,我会将 VS2008 调试器附加到正在运行的 Nunit 进程 (调试 -> 附加到进程),并在我想要的代码上设置任何断点 检查。当我点击 NUnit 中的“运行”按钮时,它会点击 断点。 (顺便说一句,如果重要的话,它正在运行 NUnit 2.5.2)。
我刚刚升级到 NUnit 2.5.4 和 VS 2010。当我设置断点时, 然后附加到 NUnit,我在断点上收到一个小警告符号 点,并将鼠标悬停在它上面会给出工具提示“断点不会 打。当前没有加载任何符号”。转到“调试”->“Windows”->“模块”窗口,显示一大堆 Windows 和 NUnit 模块 已加载,符号状态为“跳过加载符号”,然后 1 个模块,其名称很有趣,每次都会更改(r1euhmh5 右 现在),符号状态为“未加载符号”。 (没有像我的测试中的 DLL 这样的远程名称模块的痕迹)。
右键单击有趣的文件名(假设这是我的一些映射) DLL 正在测试),然后单击“加载符号来自”->“符号路径,和 导航到 bin\debug 文件夹,然后单击我的 pdb 文件 正在测试 DLL 时,我收到消息“在中找不到匹配的符号” 此文件夹”。(“打开”对话框的顶部有一行内容: “原始位置:r1euhmh5.pdb”)
那么发生了什么变化?我该如何进行调试/断点 在 VS 2010/NUnit 2.5.4 下(或者有可能我搞砸了一些东西 当我决定检查 VS2010 选项并将其中一些设置为 比我知道的更高级?)
我感谢任何帮助。
(I just posted this in the NUnit discussion group on groups.google.com)
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". (There is no trace of a module with a name remotely like my DLL under test).
Right clicking the funny 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不确定我到底理解为什么,但答案是将调试器附加到 nunit-agent.exe 而不是 nunit.exe。请在此处查看 Charlie Poole 的回复
I'm not sure I understand exactly why, but the answer is to attach the debugger to nunit-agent.exe instead of nunit.exe. See Charlie Poole's response here
有关此博客文章 关于如何在 nunit.exe 配置文件中告诉 NUnit 使用正确的 .Net 框架。
在配置文件中修复此问题的好处是,它允许您设置单元测试项目,以便在选择“调试”->“调试”时可以将 NUnit 作为外部命令启动。启动新实例。
There's information on this blog post about how to tell NUnit to use the correct .Net framework in the nunit.exe configuration file.
The benefit to fixing this in the configuration file is that it allows you to set up your unit test project so that you can launch NUnit as an external command when you select Debug -> Start New Instance.