【问题标题】:WatiN, NUnit and CruiseControl.NET-- Error message 800704a6WatiN、NUnit 和 CruiseControl.NET - 错误消息 800704a6
【发布时间】:2011-07-06 17:25:48
【问题描述】:

通过 CruiseControl.NET(作为服务)使用 WatiN 在 NUnit 中运行一组测试时,会出现以下错误:

SetUp : System.Runtime.InteropServices.COMException : 
Creating an instance of the COM component with CLSID
{0002DF01-0000-0000-000-000000000046} from the IClassFactory 
failed due to the following error: 800704a6.
TearDown : System.NullReferenceException : Object reference 
not set to an instance of an object. 

此错误一直是调试的噩梦,因为它不一致(发生率为 25% 的时间)并且不可重现。有没有人有类似的问题?

【问题讨论】:

    标签: nunit cruisecontrol.net watin comexception


    【解决方案1】:

    重启机器

    Windows 更新妨碍了实例化新 COM 对象。

    在查看了 ServerFault 和 StackOverflow 之后,我发现了几篇提到 800704a6 错误代码的帖子。

    这个特别让我点击 - https://serverfault.com/questions/179156/ie8-script-error-800704a6 指出错误代码就像是 ERROR_SHUTDOWN_IS_SCHEDULED

    我也有同样的错误:

    Creating an instance of the COM component with CLSID {0002DF01-0000-0000-000-000000000046} from the IClassFactory failed due to the following error: 800704a6

    【讨论】:

      【解决方案2】:

      AFAIK WatiN 需要用户(即桌面)会话才能工作。因此我的猜测是:

      • 您正在以普通用户帐户的身份运行 CruiseControl.Net 服务
      • 此帐户(通常)已登录到托管 CruiseControl.Net 的服务器
      • 没有可用的桌面会话时测试失败

      过去选中“允许服务与桌面交互”框(服务属性,选项卡“登录”)就足够了,但我不确定这在 Vista 之后是否仍然有效。什么会起作用(但以一种丑陋的、骇人听闻的方式)是从控制台运行 CruiseControl.Net,在桌面会话中而不是作为服务。

      【讨论】:

      • 感谢您的回复——知道为什么测试会在 75% 的时间内运行(并通过)吗?
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-05
      • 2011-10-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多