4

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

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% 的时间)并且不可重现。有没有人有类似的问题?

4

2 回答 2

4

重启机器

有一些 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

于 2012-01-10T01:42:23.337 回答
2

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

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

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

于 2011-07-12T20:07:30.407 回答