在 Visual Studio 2010 中为 IE 中的 BHO 使用断点
我正在 Visual Studio 2010 中开发 BHO。到目前为止,我已成功注册 BHO 并在点击调试时让 Visual Studio 启动 IE。 BHO 按预期工作,但不幸的是我设置的断点从未被击中。有什么需要先配置的吗?
I'm developing a BHO in Visual Studio 2010. So far I've managed to register the BHO and get visual studio launch IE when I hit debug. The BHO works as expected but unfortunately break points that I set are never hit. Is there something that needs to be configured first?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您使用 .NET 4.0,调试器将无法正确连接到 IE。因此,您要做的就是:
以管理员身份运行 Visual Studio。
将以下代码添加到您的 BHO:
尝试一下布局;我会说在网站设置后设置它。
独立于 Visual Studio 运行 Internet Explorer。就像不要从 Visual Studio 中启动 IE 一样。当 IE 运行时你会看到一个崩溃窗口(上面代码的结果);此时您可以将 Visual Studio 附加到 IE。完成了,完成了。
If you're using .NET 4.0 the debugger won't attach properly to IE. So here is what you do:
Run Visual Studio as an administrator.
Add the following code to your BHO:
Experiment a bit with placement; I'd say set it after the site is set.
Run Internet Explorer independently of Visual Studio. As in don't launch IE from within Visual Studio. When IE runs you will get a crash window (the result of the code above); that's when you can attach Visual Studio to IE. Done and done.
您确定您已经注册了“调试”dll 而不是发布版本(不包含调试信息)吗?
我个人创建了一个注册 dll 的脚本,并且每次编译(后处理)时都会执行该脚本。
希望有帮助!
编辑:
我正在使用 VS 2008,但是你能检查一下你的配置是否与我的一致吗?
Are you sure you have registered the 'debug' dll and not the release one (that didn't contain debugging information) ?
Personally I created a scrip that register the dll and this script is executed each time I compile (post-processing).
Hope that help !
EDIT:
I'm using VS 2008 but could you check if your configuration correspond to mine ?
请参阅此处< /a> 获取正确连接调试器和调试 BHO 项目所需步骤的完整描述。
Please refer here for a complete description of steps needed to properly attach the debugger and debug a BHO project.