0

I'm trying to automate Internet Explorer using WatiN library in a Web App hosted on azure. I'm getting the following exception when trying to create an instance of IE :

System.Runtime.InteropServices.COMException (0x80080005): 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))

First, is it possible to automate IE in a web application that is hosted on azure? (I know it's a bad idea to do so anyway) And how to solve this exception if it's possible.

Update : Before getting this exception I was getting another one saying that Interop.SHDocVw.dll was not found. I set Imbed Interop Types property to false and Copy Local to true and the exception is gone.

1 Answer 1

1

What you are trying to achieve is only possible with Cloud Services (Web and Worker Roles) or in Virtual Machines.

Web Apps (that run on App Service Plans) do not support any kind of COM interaction. And your code fails, because it tries to communicate with the IE standard COM interfaces.

You can learn more about Cloud Services here and Virtual Machines here.

5
  • 1
    Not just web roles. Worker roles too, as well as Windows-based Virtual Machines. Commented Nov 1, 2016 at 10:56
  • Is there any specific setting that I need to do in order to allow com interaction on Cloud Service?
    – Kira
    Commented Nov 2, 2016 at 8:38
  • usually not, but if it fails, you may try running your instance in Elevated Mode (which will cause it to run under Local System account). Check here: blogs.msdn.microsoft.com/farida/2012/05/01/…
    – astaykov
    Commented Nov 3, 2016 at 7:17
  • after deploying my app to a Cloud Service I got this exception System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {0002DF01-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
    – Kira
    Commented Nov 3, 2016 at 13:07
  • Also in Elevated runtime context?
    – astaykov
    Commented Nov 3, 2016 at 14:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.