WatiN, NUnit and CruiseControl.NET— Error message 800704a6

那年仲夏 提交于 2019-11-28 08:40:51

问题


When running a suite of tests in NUnit with WatiN through CruiseControl.NET (as a service), this error appears:

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. 

This error has been a nightmare to debug because it is not consistent (happens 25% percent of the time) and is not reproducible. Has anyone has any similar issues?


回答1:


Reboot the machine

There are windows updates getting in the way of instantiating new COM objects.

After looking around on ServerFault and StackOverflow, I found several posts that mention the 800704a6 error code.

This one in particular made it click for me - https://serverfault.com/questions/179156/ie8-script-error-800704a6 stating that the error code was like to be ERROR_SHUTDOWN_IS_SCHEDULED

I had that exact error too:

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 needs a user (i.e. desktop) session to work. Thus my guess is:

  • you are running CruiseControl.Net service as a normal user account
  • this account is (usually) logged into the server hosting CruiseControl.Net
  • the tests fail when there is no desktop session available

It used to be enough to check the box "Allow Service to Interact with Desktop" (Service Properties, tab "Log On"), but I'm not sure this still works after Vista. What will work (but in an ugly, hackish way) is running CruiseControl.Net from console, in a desktop session instead of as a service.



来源:https://stackoverflow.com/questions/6600482/watin-nunit-and-cruisecontrol-net-error-message-800704a6

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!