How to fix "The requested resource is in use. (Exception from HRESULT: 0x800700AA)"

15

How can I solve this error?

"The requested resource is in use. (Exception from HRESULT: 0x800700AA)".

This appears while navigating to a different website using the WebBrowser control in C# .NET. Why?

c#
.net
webbrowser-control
asked on Stack Overflow Feb 3, 2010 by Jepe d Hepe • edited Jan 21, 2016 by TylerH

6 Answers

13

The WebBrowser control is considered "in use" if either a navigation action is currently being processed, or any blocking dialog from the control is currently open (including context menu, Javascript alerts, NTLM login dialog, etc.). You can use the WebBrowser.IsBusy property to detect these states.

If due to a currently incomplete navigation action, you could try to stop the current navigation (if you indeed want to stop when the page is not completed loaded) or add the new navigation to a request queue and use a timer to wait until WebBrowser.IsBusy returns false.

If instead the busy state is due to one or more open blocking dialogs, you could do the same wait technique and perhaps Messagebox.Show() the user a message that pending navigation is delayed due to an open dialog window.

answered on Stack Overflow Feb 10, 2010 by Sheng Jiang 蒋晟 • edited Oct 8, 2015 by Special Sauce
4

I had this same issue. Calling WebBrowser.Stop() did not help, and WebBrowser.IsBusy never became false.

It turns out that if the page creates any sort of dialog (alert() popups, javascript errors, NTLM login popups etc.) you can't navigate away from the page until the dialog is closed.

My solution was to prevent the dialogs from showing in the first place. Apparently preventing all of these popups is simple; just set

webBrowser.ScriptErrorsSuppressed = true;
answered on Stack Overflow Dec 16, 2013 by BlueRaja - Danny Pflughoeft • edited May 23, 2017 by Community
2
bool go = false;
string SiteContent1 = string.Empty;
string SiteContent2 = string.Empty;
int index = 0;
WebBrowser wb = new  WebBrowser();

    void wb_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
    {

        try
        {
            if (go)
            {
                SiteContent2 = wb.DocumentText;
                // Code to compare to contents of the webbrowser
                index++;
                go = false;
                steps = 1;
            }

            if (!go)
                {

                    if (index >= TotalSiteCount)
                    {
                        Stop();
                    }
                    else if (steps == 1)
                    {
                        wb.Navigate(UrltocompareList[index].Url1);

                    }
                    else if (steps == 2)
                    {
                        SiteContent1 = wb.DocumentText;
                        wb.Navigate(UrltocompareList[index].Url2);
                        go = true;
                    }
                    steps++;                        
                }

        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.Message);

        }

    }

UrltocompareList is a collection of 2 sites to compare.
TotalSiteCount is the number of items in UrltocompareList.
The form for this inherit IOleClientSite to remove media such as images, videos and no active X download to have a faster rendering time in webbrowser control.

I use this method instead of system.net.webclient to get the html of a webpage then compare them.
I got this error when it hits the wb.Navigate method.

answered on Stack Overflow Feb 4, 2010 by Jepe d Hepe
1

An issue I ran into when running specflow tests with watin in windows 10 is that win10 by default uses MS Edge, so I had never opened IE, and when watin started it IE was stuck on the prompt for using default settings. Selecting options, closing browser and running tests again worked for me.

Just something to watch

answered on Stack Overflow Sep 16, 2015 by BlackICE
0

This can be solved pretty easily. This error occurs when the browser commits an action while he's already performing an action. For example, you are navigating to some website while you rightclick in the web browser. To solve this, I did the follow:

//if my webbrowser isn't performing any actions
if(!myWebBrowser.IsBusy)
{
   //Navigate
   myWebBrowser.Navigate("http://www.google.com");
}
answered on Stack Overflow Dec 22, 2013 by eli
0

First Try

1- Please Check Navigate URL's (if you check, please check again compiled folder)

2- Delete WebBrowser Control and Add New

Me forget copy original file App.Path + "\error.html" and see this problem.

Guarantee Method

I Fix This Error in VB6

Add WebBrowserControl wb(0) (Name wb , Index=0)

And Before Ever Navigate

For i = 1 To wb.UBound

    Unload wb(i)

Next

Load wb(1)

wb(0).Visible = False

wb(1).Visible = true

wb(1).Navigate URL
answered on Stack Overflow Aug 19, 2015 by zersina • edited Sep 16, 2016 by Lightman

User contributions licensed under CC BY-SA 3.0