Hi,
we have embedded the .NET WebBrowser control (actually two in different tabs, if that for some reason may be important) in a dialog and are running into a strange problem. I have not been able to reproduce the problem outside the complete application, so I assume we're doing something with side-effects elsewhere. Because of this, I am not able to post any code to reproduce the problem, but I was still hoping that someone may at least have a suggestion on how to debug the situation and perhaps find the reason for the component to fail.
Usually, everything works as expected. We add the control to our dialog and invoke its Navigate method to get an HTML page from a server. In some cases (perhaps 20-25% of the attempts), the control stays blank and keeps displaying the waiting cursor. The problem is not reproducible, when loading the same URL from a standalone IE.
In an attempt to locate the problem, we are logging the Navigating, Navigated, DocumentCompleted, ProgressChanged and StatusTextChanged events. In the situations where it works, we see the Navigating, Navigated and DocumentCompleted events in this order and several ProgressChanged and StatusTextChanged events (with reasonable values) mixed in between.
In the situations where the component fails, only the Navigating event is fired. Both the server log and a network dump confirms however, that the document is requested and delivered correctly from the server. Malformed or illegal content is of course at least a theoretical possibility, but I would have expected at least a Navigated event from the component, before it even tries to analyze whatever the server is delivering. We are also able to reproduce both successful and failing behaviour with exactly the same HTML document.
So back to my original question: The description of the situation is perhaps a little thin and I don't expect a finished solution for this problem, but can someone perhaps at least suggest where to look and what to look for? I am not too experienced with .NET development, but since the WebBrowser probably is just a thin layer around IE's ActiveX component, I doubt that I'm able to debug into its internals to find any probable causes for the problem?