Search code examples
watinappharbor

WatiN on AppHarbor: COMException, "Server execution failed"


I'm using WatiN in a console application. I set platform to x86, and I added [STAThread] to my Main. I confirmed that the application is actually running in 32-bit mode (which WatiN requires).

WatiN works fine when testing locally, but crashes when running on AppHarbor:

[COMException: Retrieving the COM class factory for component with CLSID {0002DF01-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).]

0007FFB8B2184B3 WatiN_Core!WatiN.Core.IE.CreateNewIEAndGoToUri(System.Uri, WatiN.Core.Interfaces.IDialogHandler, Boolean)+0x103

How can I get WatiN working on AppHarbor?


Solution

  • To be able to run WatIn it need to have access (as an administrator) to some resources. When you run a COM object it needs to be able to query the registry to find out if Internet Explorer is a COM object in that system and if it is launch it. I don't have first hand experience with AppHarbor but I'm pretty sure they won't allow you to be able to query what COM servers their machines have so they won't provide you with that access.

    To be 100% sure about this you should ask them if you can have access to query COM objects on their machines.

    When you run it on your local machine that works because either you are logged in as an admin or you are launching the process as an admin.

    Hope this helps.