We're experiencing a very weird issue in our WPF app.
On startup our app fires off some service requests. Then when the window is loaded is unresponsive until we press a key. CPU usage is 0%.
It looks like a UI deadlock although not a true one - we can resize it and move it. When attaching the debugger, we see the main thread is on Win32.UnsafeNativeMethods.GetMessageW - it's not waiting on a lock as you normally see in this type of issues.
Then if we press a key, it continues processing actions we have passed in to Dispatcher.BeginInvoke.
This happens on both debug and release builds but only when it's built by the MSBuild tool. If I build the app on my PC in both VS2010 and VS2012 - both targeting .NET 4.0 - the issue never happens.
Any ideas as to how identify what's preventing the Dispatcher from executing actions till a key is pressed?
Regards.
P.S - See below the UI thread stack trace.
WindowsBase.dll!MS.Win32.UnsafeNativeMethods.GetMessageW(ref System.Windows.Interop.MSG msg, System.Runtime.InteropServices.HandleRef hWnd, int uMsgFilterMin, int uMsgFilterMax) + 0x14 bytes
WindowsBase.dll!System.Windows.Threading.Dispatcher.GetMessage(ref System.Windows.Interop.MSG msg, System.IntPtr hwnd, int minMessage, int maxMessage) + 0x80 bytes WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame frame) + 0x75 bytes
WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame frame) + 0x49 bytes
WindowsBase.dll!System.Windows.Threading.Dispatcher.Run() + 0x4b bytes
PresentationFramework.dll!System.Windows.Application.RunDispatcher(object ignore) + 0x17 bytes
PresentationFramework.dll!System.Windows.Application.RunInternal(System.Windows.Window window) + 0x6f bytes PresentationFramework.dll!System.Windows.Application.Run(System.Windows.Window window) + 0x26 bytes PresentationFramework.dll!System.Windows.Application.Run() + 0x1b bytes MyApp.App.Main() Line 50 + 0xa bytes