捕获 IE 嵌入式 UserControl 加载时的错误

发布于 2024-08-02 15:58:04 字数 174 浏览 1 评论 0原文

我有一个通过对象标记嵌入到 asp.net 页面中的 UserControl (.dll),通常该控件加载正常,但如果加载失败,它只会显示一个空白页面,左上角有一个图标。有没有办法在加载用户控件期间捕获任何错误或查看任何错误消息? Visual Studio 2008 调试器似乎无法在这种情况下提供帮助。

/丹尼尔

I have a UserControl (.dll) that is embedded via the object tag in a asp.net page, normally the control loads fine but when it does not it only shows a blank page with a icon in the top left corner. Is there any way to trap any errors or view any error messages during the loading of the UserControl? The visual studio 2008 debugger does not seem to be able to help out in this case.

/Daniel

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

少女七分熟 2024-08-09 15:58:04

您是否已将调试器附加到 iexplore.exe 进程?你的dll加载了吗? (调试时 VS 中的模块窗口。)

您可以在 IE 中启用 .net 控件加载的日志记录: http://support.microsoft.com/kb/313892

您可以启用融合日志记录以查看依赖程序集是否存在任何其他问题:htREMOVETHIStp://blogs.msdn.com/suzcook/archive/2003/ 05/29/57120.aspx, httREMOVETHISp://msdn.microsoft.com/en-us/library/e74a18c4%28VS.71%29.aspx

我遇到的问题:

  • 确保所有需要的程序集都在正确的位置目录。您可以使用Fiddler之类的工具来查看IE请求的内容。 httREMOVETHISp://www.fiddler2.com/fiddler2/
  • 通常默认权限是不够的,IE 中的嵌入式 .net 控件在受限权限下运行。你必须使用caspol来授予更多权限:httREMOVETHISp://stackoverflow.com/questions/1050574/caspol-fulltrust-and-running-an-activex-control-in-ie-with-fulltrust-based-on-ur看看出安全异常。
  • 留意下载缓存中的旧版本(命令行上的 gacutil /ldlgacutil /cdl)以及临时 Internet 文件代码>.如果嵌入式控件不起作用,最好清除两者。

祝你好运。 (你会需要它...)

对于删除感到抱歉,因此对链接进行了投诉。

Have you attached the debugger to the iexplore.exe process? Does your dll get loaded? (Modules window in VS when debugging.)

You can enable logging for the loading of a .net control in IE: http://support.microsoft.com/kb/313892

You can enable fusion logging to see if there are any further issues with dependant assemblies: htREMOVETHIStp://blogs.msdn.com/suzcook/archive/2003/05/29/57120.aspx, httREMOVETHISp://msdn.microsoft.com/en-us/library/e74a18c4%28VS.71%29.aspx

Issues I've had:

  • Be sure that all the needed assemblies are in the right directories. You can use a tool like Fiddler to see what is requested by IE. httREMOVETHISp://www.fiddler2.com/fiddler2/
  • Often the default permissions are not enough, embedded .net controls in IE run under restricted permissions. You have to use caspol to give more permissions: httREMOVETHISp://stackoverflow.com/questions/1050574/caspol-fulltrust-and-running-an-activex-control-in-ie-with-fulltrust-based-on-ur Look out for SecurityExceptions.
  • Look out for old versions hanging around in the download cache (gacutil /ldl and gacutil /cdl on the command line), and in the Temporary Internet Files. It is best to clear both if the embedded control doesn't work.

Good luck. (You're gonna need it...)

Sorry about the REMOVETHIS, SO complained about the links.

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