I had an application designed in WPF on VS2008 using Windows 7 32-bit machine and deployed on Windows XP. Tested and everything worked fine.
Recently, some cosmetic and business logic changes were required. This time I used VS2010 and made the required changes. Tested and deployed on Windows XP everything works fine. However when deployed on Windows 7 32-bit, the application crashes.
After looking at the logs, I narrowed it down to this probably piece of code :
protected virtual void SomeEventHandlerMethod()
{
try
{
System.Windows.Application.Current.Dispatcher.Invoke(
DispatcherPriority.Normal,
new Action<Data>(FollowMethod), new dData(SubTypeData));
}
catch (Exception ex)
{
Logger.ErrorException(ex.Message, ex);
}
}
Following is the stack trace of the exception thrown :
System.Threading.ThreadAbortException: Thread was being aborted.
at System.Threading.WaitHandle.WaitOneNative(SafeWaitHandle waitHandle, UInt32 millisecondsTimeout, Boolean hasThreadAffinity, Boolean exitContext)
at System.Threading.WaitHandle.WaitOne(Int64 timeout, Boolean exitContext)
at System.Threading.WaitHandle.WaitOne(TimeSpan timeout, Boolean exitContext)
at System.Windows.Threading.DispatcherOperation.DispatcherOperationEvent.WaitOne()
at System.Windows.Threading.DispatcherOperation.Wait(TimeSpan timeout)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
at Fully Qualified name of the method SomeEventHandlerMethod()
I am not able to figure out the reason of the application crash when running on Windows 7. I MUST figure this out. HELP!