J
Jeroen
We are experiencing a tuff-to-debug problem ever since we introduced a
WebBrowser control into our failry large application. I'm not sure if
the problem description below contains enough details, so if I need to
elaborate on something please ask for it.
We have a UserControl with a WebBrowser on it. This UserControl is
instantiated a few times during the program run, depending on user
interaction. The WebBrowser then navigates to a local HTML file. I
catch the navigating event and always cancel it, instead taking some
custom action.
At irregular and hard-to-reproduce times, we get an
InvalidOperationException when closing the application. The debugger
is not able to open a code file where it happens, it just shows a
popup with the exception. Here's a trace:
------------------------- TRACE -------------------------------
System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate
method, Object[] args, Boolean synchronous)
at System.Windows.Forms.Control.BeginInvoke(Delegate method,
Object[] args)
at
System.Windows.Forms.WindowsFormsSynchronizationContext.Post(SendOrPostCallback
d, Object state)
at System.Windows.Forms.AxHost.ConnectionPointCookie.Finalize()</
StackTrace><ExceptionString>System.InvalidOperationException: Invoke
or BeginInvoke cannot be called on a control until the window handle
has been created.
at System.Windows.Forms.Control.MarshaledInvoke(Control caller,
Delegate method, Object[] args, Boolean synchronous)
at System.Windows.Forms.Control.BeginInvoke(Delegate method,
Object[] args)
at
System.Windows.Forms.WindowsFormsSynchronizationContext.Post(SendOrPostCallback
d, Object state)
at System.Windows.Forms.AxHost.ConnectionPointCookie.Finalize()</
ExceptionString></Exception></TraceRecord>
The program '[2648] MyApplication.vshost.exe: Managed' has exited with
code 0 (0x0).
------------------------------------------------------------------------
It almost seems like the 'Finalize' method of the webbrowser's
ConnectionPointCookie is being called twice (?).
Is there any way to check this?
Should I be looking for a solution/the problem in different parts of
the code?
WebBrowser control into our failry large application. I'm not sure if
the problem description below contains enough details, so if I need to
elaborate on something please ask for it.
We have a UserControl with a WebBrowser on it. This UserControl is
instantiated a few times during the program run, depending on user
interaction. The WebBrowser then navigates to a local HTML file. I
catch the navigating event and always cancel it, instead taking some
custom action.
At irregular and hard-to-reproduce times, we get an
InvalidOperationException when closing the application. The debugger
is not able to open a code file where it happens, it just shows a
popup with the exception. Here's a trace:
------------------------- TRACE -------------------------------
System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate
method, Object[] args, Boolean synchronous)
at System.Windows.Forms.Control.BeginInvoke(Delegate method,
Object[] args)
at
System.Windows.Forms.WindowsFormsSynchronizationContext.Post(SendOrPostCallback
d, Object state)
at System.Windows.Forms.AxHost.ConnectionPointCookie.Finalize()</
StackTrace><ExceptionString>System.InvalidOperationException: Invoke
or BeginInvoke cannot be called on a control until the window handle
has been created.
at System.Windows.Forms.Control.MarshaledInvoke(Control caller,
Delegate method, Object[] args, Boolean synchronous)
at System.Windows.Forms.Control.BeginInvoke(Delegate method,
Object[] args)
at
System.Windows.Forms.WindowsFormsSynchronizationContext.Post(SendOrPostCallback
d, Object state)
at System.Windows.Forms.AxHost.ConnectionPointCookie.Finalize()</
ExceptionString></Exception></TraceRecord>
The program '[2648] MyApplication.vshost.exe: Managed' has exited with
code 0 (0x0).
------------------------------------------------------------------------
It almost seems like the 'Finalize' method of the webbrowser's
ConnectionPointCookie is being called twice (?).
Is there any way to check this?
Should I be looking for a solution/the problem in different parts of
the code?