Automate Internet Explorer on Azure

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.

c#
azure
internet-explorer
automation
asked on Stack Overflow Nov 1, 2016 by Kira

1 Answer

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.

answered on Stack Overflow Nov 1, 2016 by astaykov • edited Nov 1, 2016 by astaykov

User contributions licensed under CC BY-SA 3.0