views:

3253

answers:

1

I use a WebBrowser control in my Winforms application. When I navigate to a Url that causes a JavaScript exception the Just-In-Time (JIT) debugger window shows up asking if you want to debug this exception:

An Unhandled exception ('Object expected') occured in (application)

This happens (in Release mode) even though I set the ScriptErrorsSuppressed on the WebBrowser control to True. I could only reproduce the issue when Visual Studio was installed so I assume that the JIT debugger catches the exception and then ask if you want to Debug.

How can I prevent this from happening? What I am trying to do is catch the exception or disable JIT debugging for my application without having to reconfigure IE or Visual Studio.

Some of our users have Visual Studio installed and these JIT popups make our application unusable.

+1  A: 

See this link for how to disable the JIT debugger. The short version is open Visual Studio as an Admin and navigate to Tools -> Options -> Debugger -> JIT Debugging

http://msdn.microsoft.com/en-us/library/k8kf6y2a.aspx

JaredPar
Thanks for the link. What I am trying to do is deactivate JIT debugging for my application (not on my machine) - so that customers (even if they have debugging tools installed) will not see this message.
Patrick Klug