0

Im trying to close an internet explorer window using a dll file in C#.

The attempt is successful if run it in my local pc but if i use the dll in my website im getting this error: Attached the exact error msg from IISRetrieving the COM class factory for component with CLSID {9BA05972-F6A8-11CF-A442-00A0C90A8F39} failed due to the following error.

This is my function to close the window

    public void CloseExistingEvar()
    {
        SHDocVw.ShellWindows shellWindows = new SHDocVw.ShellWindows();
        string filename;
        foreach (SHDocVw.InternetExplorer ie in shellWindows)
    {
        filename = Path.GetFileNameWithoutExtension(ie.FullName).ToLower();
        if (filename.Equals("iexplore"))
        {
            string[] urlParts = (ie.LocationURL.ToString()).Split('/');
            if (urlParts.Contains("E_VAR"))
            {
                ie.Quit();
            }
        }
    }
}

I dont know how to get the process identity of the IIS7.5 and give permission to this process.

1 Answers1

0

See https://forums.asp.net/t/1093228.aspx?Retrieving+the+COM+class+factory+for+component+with+CLSID+00024500+0000+0000+C000+000000000046+failed+due+to+the+following+error+80070005

Looks like you can add Launch and Activation Permissions for your CLSID, which is the ShellWindows service.

daisy
  • 22,498
  • 29
  • 129
  • 265