I have a WPF application with a form that, when started, invokes a custom method in a new thread.
Private Sub TestStep1_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded
Dim oThread As New Thread(AddressOf DisplayNextPicture)
oThread.Start()
End Sub
Private Sub DisplayNextPicture()
'' do stuff
End Sub
This works fine on my machine, but on a client's machine the launching of the new thread results in a MissingMethodException. I'm not sure why this would happen (and unfortunately the client is in a remote location so I'm having to debug this by slipping in trace statements and trial and error). It is definitely the DisplayNextPicture() method that is not being found, as I've been able to determine via tracing.
The only thing I can think of is that this has to do with security at the framework level. Are there restrictions on launching new threads from a WPF application?
I'm unable to catch this exception via Application.DispatcherUnhandledException so I cannot get any exception details or stack trace. The client gets a .NET runtime exception dialog with the following info and this is the only way I know the exception type:
EventType : clr20r3 P1 : testapp.exe P2 : 1.0.0.0 P3 : 49fa2234 P4 : mscorlib P5 : 2.0.0.0 P6 : 471ebc5b P7 : 1295 P8 : 14
P9 : system.missingmethodexception
Please help :)