Microsoft Communities

Welcome to WindowsClient.net | Sign in | Join

Here are some frequently asked questions about Windows Forms and their answers.

Windows Forms FAQs

Why doesn't the debugger catch exceptions in webBrowser events?

Note: It is recommended that during development you put try catch blocks around the contents of all WebBrowser methods.

Since the core of the managed WebBrowser is an unmanaged ActiveX control, it captures all exceptions thrown in its methods before they can be passed to the debugger. This can lead to unusual behavior if you are not catching the exceptions before they leave the method. For this reason it is highly recommended that try catch blocks should be placed around the contents of all WebBrowser methods during the development and test phases, with special attention paid to procedures that could potentially throw exceptions.



Page view counter