c# - 等待 "Unable to cast COM object"异常

标签 c# browser object com watin

有时,我的监控应用程序会无缘无故地死掉。似乎“mshtml.HTMLDocument”资源不可用。还有其他人经历过类似的事情吗?提前致谢。

错误信息:

14.04.2011 18:26:37 -> Test 1.2 (Subscriber type requests), error: Unable to cast COM object of type 'System.__ComObject' to interface type 'mshtml.HTMLDocument'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{3050F55F-98B5-11CF-BB82-00AA00BDCE0B}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

错误堆栈跟踪:

14.04.2011 18:26:37 -> Test 1.2 (Subscriber type requests), trace:    at WatiN.Core.Native.InternetExplorer.IEWaitForComplete.WaitForFramesToComplete(IHTMLDocument2 maindocument)
   at WatiN.Core.Native.InternetExplorer.IEWaitForComplete.WaitForFramesToComplete(IHTMLDocument2 maindocument)
   at WatiN.Core.Native.InternetExplorer.IEWaitForComplete.WaitForCompleteOrTimeout()
   at WatiN.Core.WaitForCompleteBase.DoWait()
   at WatiN.Core.IE.WaitForComplete(Int32 waitForCompleteTimeOut)
   at WatiN.Core.Browser.GoTo(Uri url)
   at WatiN.Core.Browser.GoTo(String url)
   at WebMonitor.Tests.Execute() ...

最佳答案

感谢您的报告。我已经重新尝试了 Actor 阵容。这个异常很可能是时序引起的。希望重试能解决它。将成为下一个版本的一部分或从 SourceForge 获取最新代码。

关于c# - 等待 "Unable to cast COM object"异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5664880/

相关文章:

c# - 正则表达式 ",\\s(.*?),\\s"

c# - 无法在表单中找到 {Microsoft.VisualBasic.PowerPacks.RectangleShape} 控件

c# - 在asp net core 3.1中使用RouteDataRequestCultureProvider

javascript - 如果用户禁用了 JS,浏览器会下载 JS 文件吗?

PHP 对象创建循环

javascript - 如何在javascript中访问另一个数组内的对象数组内的对象?

c# - 如何减少和增加曲线的值

javascript - 使用 WebAssembly 获取域的 IP 地址或进行 DNS 请求

javascript - 确定浏览器是否正在使用移动数据或 wifi?

JavaScript:更长的键是否会使对象查找变慢?