在 Visual Studio 2010 中为 IE 中的 BHO 使用断点

发布于 2024-10-03 02:59:29 字数 123 浏览 1 评论 0原文

我正在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

如果没有 2024-10-10 02:59:29

如果您使用 .NET 4.0,调试器将无法正确连接到 IE。因此,您要做的就是:

以管理员身份运行 Visual Studio。

将以下代码添加到您的 BHO:

Debugger.Break();

尝试一下布局;我会说在网站设置后设置它。

独立于 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:

Debugger.Break();

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.

与君绝 2024-10-10 02:59:29

您确定您已经注册了“调试”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 ?
alt text

白馒头 2024-10-10 02:59:29

Please refer here for a complete description of steps needed to properly attach the debugger and debug a BHO project.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文