J
Jon Skeet [C# MVP]
I've got a very bizarre problem to debug.
I have an application with various threads, two of which are of
interest here:
1) The UI thread
2) A background thread talking to a server
The UI has a status indicator to show whether the connection is
working, etc.
The background thread's main class has an event saying when the state
has changed. The UI subscribes to that event with two different
delegates. One of these delegates uses Control.Invoke to change the UI
itself - there's no nastiness like changing the UI from a different
thread, as far as I can see.
Now, most of the time, it all works fine, and I can step through both
delegates. When the connection has failed, however, invoking the
multicast delegate (which contains the two other delegates) invokes the
first delegate (which I can step through) but then throws a
MissingMethodException.
It has nothing to do with what the state has changed to - the same
value works fine if there hasn't been a connection failure.
Removing either of the delegates makes it work (as in not fall over).
I'm at a loss... any ideas?
I have an application with various threads, two of which are of
interest here:
1) The UI thread
2) A background thread talking to a server
The UI has a status indicator to show whether the connection is
working, etc.
The background thread's main class has an event saying when the state
has changed. The UI subscribes to that event with two different
delegates. One of these delegates uses Control.Invoke to change the UI
itself - there's no nastiness like changing the UI from a different
thread, as far as I can see.
Now, most of the time, it all works fine, and I can step through both
delegates. When the connection has failed, however, invoking the
multicast delegate (which contains the two other delegates) invokes the
first delegate (which I can step through) but then throws a
MissingMethodException.
It has nothing to do with what the state has changed to - the same
value works fine if there hasn't been a connection failure.
Removing either of the delegates makes it work (as in not fall over).
I'm at a loss... any ideas?