“当前不会命中断点"调试混合模式应用程序时出错(c# 和非托管 c++) [英] "The breakpoint will not currently be hit" error while debugging a mixed mode application (c# and unmanaged c++)

查看:49
本文介绍了“当前不会命中断点"调试混合模式应用程序时出错(c# 和非托管 c++)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 VS2010 中调试混合模式应用程序时,在非托管 c++ dll 源文件(从托管 c# 包装类调用)中包含的一行代码上设置的断点显示臭名昭著的当前不会命中断点.否已为此文档加载符号"信息消息,将鼠标悬停在相关行的断点上.断点本身是一个带有黄色信息三角形的红色圆圈,而不是通常的纯红色球体.当然,执行调试器时不会命中断点.我为这个警告找到的大多数答案都表明断点设置不正确,或者没有加载预期的 dll,或者关联的 pdb 文件没有位于正确的位置等等.这不是问题.应用程序确实加载并正确执行引用的 dll.我已经验证了正确的 pdb 文件(与其 dll 具有相同的文件日期)与目标 dll 本身一起位于可执行文件的工作目录中.调试器根本不会加载 dll 的符号,并且 dll 不会显示在模块列表中.

While debugging a mixed mode application in VS2010, the breakpoint set on a line of code contained in an unmanaged c++ dll source file (called from a managed c# wrapper class) shows the infamous "The breakpoint will not currently be hit. No symbols have been loaded for this document" info message when hovering the mouse over the breakpoint on the line in question. The breakpoint itself is a red circle with a yellow info triangle instead of the usual solid red orb. Of course, the breakpoint isn't hit when the debugger is executed. Most answers I've found for this warning indicate the breakpoint hasn't been set properly, or that the expected dll is not being loaded, or that the associated pdb file is not located in the correct location, etc. etc. This is not the problem. The application does load and execute the referenced dll correctly. I've verified that the correct pdb file, with the same file date as its dll, is located in the executable's working directory along with the target dll itself. The debugger simply doesn't load the symbols for the dll, and the dll doesn't show in the Modules list.

我在网上找到的所有解决方案都无法解决此问题.该 dll 不会显示在调试->Windows->模块"菜单选项中可用的模块列表中...即使它实际上已加载.包装类中设置的断点正常工作.

None of the solutions I've found online work for this problem. The dll doesn't show in the modules list available from 'Debug->Windows->Modules' menu selection... even though it is, in fact, loaded. Breakpoints set in the wrapper class work correctly.

删除 bin 和 obj 目录,清理和重建解决方案也无济于事.

Deleting the bin and obj directories, cleaning and rebuilding the solution also doesn't help.

推荐答案

此问题的解决方案是在应用程序属性页的调试"选项卡中设置启用非托管代码调试"标志

The solution to this problem was to set the "Enable unmanaged code debugging" flag located in the Debug tab of the application's properties page

这篇关于“当前不会命中断点"调试混合模式应用程序时出错(c# 和非托管 c++)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆