WPF crashes when I set focus on any editable text control (TextBox/RichTextBox)
for example on this xaml:
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<TextBox/>
</Page>
when I click on TextBox in browser, following exception is occured:
Startup URI: D:\1.xaml
Application Identity: file:///D:/WINDOWS/Microsoft.Net/Framework/v3.0/WPF/XamlViewer/XamlViewer_v0300.xbap#XamlViewer_v0300.application, Version=3.0.0.0, Culture=neutral, PublicKeyToken=c3bce3770c238a49, processorArchitecture=msil/XamlViewer_v0300.exe, Version=3.0.0.0, Culture=neutral, PublicKeyToken=c3bce3770c238a49, processorArchitecture=msil, type=win32
System.NullReferenceException: Object reference not set to an instance of an object.
at System.Windows.Documents.TextStore.OnGotFocus()
at System.Windows.Documents.TextEditor.OnGotKeyboardFocus(Object sender, KeyboardFocusChangedEventArgs e)
at System.Windows.Controls.Primitives.TextBoxBase.OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
at System.Windows.UIElement.OnGotKeyboardFocusThunk(Object sender, KeyboardFocusChangedEventArgs e)
at System.Windows.Input.KeyboardFocusChangedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.KeyboardDevice.ChangeFocus(DependencyObject focus, Int32 timestamp)
at System.Windows.Input.KeyboardDevice.TryChangeFocus(DependencyObject newFocus, IKeyboardInputProvider keyboardInputProvider, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
at System.Windows.Input.KeyboardDevice.Focus(DependencyObject focus, Boolean askOld, Boolean askNew)
at System.Windows.Input.KeyboardDevice.Focus(IInputElement element)
at System.Windows.UIElement.Focus()
at System.Windows.Documents.TextEditorMouse.MoveFocusToUiScope(TextEditor This)
at System.Windows.Documents.TextEditorMouse.OnMouseDown(Object sender, MouseButtonEventArgs e)
at System.Windows.Controls.Primitives.TextBoxBase.OnMouseDown(MouseButtonEventArgs e)
at System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
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 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.StartDispatcherInBrowser(Object unused)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
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 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
-----------------------
PresentationHost.exe v3.0.6920.0 (vista_rtm_wcp.061020-1904) - D:\WINDOWS\system32\PresentationHost.exe
ntdll.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\system32\ntdll.dll
kernel32.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\system32\kernel32.dll
ADVAPI32.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\system32\ADVAPI32.dll
RPCRT4.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\system32\RPCRT4.dll
USER32.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\system32\USER32.dll
GDI32.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\system32\GDI32.dll
msvcrt.dll v7.0.2600.2180 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\system32\msvcrt.dll
ole32.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\system32\ole32.dll
SHELL32.dll v6.00.2900.2180 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\system32\SHELL32.dll
SHLWAPI.dll v6.00.2900.2180 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\system32\SHLWAPI.dll
urlmon.dll v6.00.2900.2180 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\system32\urlmon.dll
VERSION.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\system32\VERSION.dll
WININET.dll v6.00.2900.2180 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\system32\WININET.dll
CRYPT32.dll v5.131.2600.2180 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\system32\CRYPT32.dll
MSASN1.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\system32\MSASN1.dll
OLEAUT32.dll v5.1.2600.2180 - D:\WINDOWS\system32\OLEAUT32.dll
IMM32.DLL v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\system32\IMM32.DLL
LPK.DLL v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\system32\LPK.DLL
USP10.dll v1.0420.2600.2180 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\system32\USP10.dll
comctl32.dll v6.0 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll
uxtheme.dll v6.00.2900.2180 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\system32\uxtheme.dll
MSCTF.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\system32\MSCTF.dll
CLBCATQ.DLL v2001.12.4414.258 - D:\WINDOWS\system32\CLBCATQ.DLL
COMRes.dll v2001.12.4414.258 - D:\WINDOWS\system32\COMRes.dll
xpsp2res.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\system32\xpsp2res.dll
PresentationHostDLL.dll v3.0.6920.0 (vista_rtm_wcp.061020-1904) - D:\WINDOWS\Microsoft.Net\Framework\v3.0\WPF\PresentationHostDLL.dll
mscoree.dll v2.0.50727.42 (RTM.050727-4200) - D:\WINDOWS\system32\mscoree.dll
Secur32.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\system32\Secur32.dll
mlang.dll v6.00.2900.2180 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\system32\mlang.dll
dfshim.dll v2.0.50727.42 (RTM.050727-4200) - D:\WINDOWS\system32\dfshim.dll
mscorwks.dll v2.0.50727.42 (RTM.050727-4200) - D:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
MSVCR80.dll v8.00.50727.163 - D:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.163_x-ww_681e29fb\MSVCR80.dll
mscorlib.ni.dll v2.0.50727.42 (RTM.050727-4200) - D:\WINDOWS\assembly\NativeImages_v2.0.50727_32\mscorlib\078803a9d87423489648368dca1d2a05\mscorlib.ni.dll
System.ni.dll v2.0.50727.42 (RTM.050727-4200) - D:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System\6dc8b30801c5fb499ff5321e039c427e\System.ni.dll
WindowsBase.ni.dll v3.0.6920.0 (vista_rtm_wcp.061020-1904) - D:\WINDOWS\assembly\NativeImages_v2.0.50727_32\WindowsBase\142847b804807f468ea1f5d31fa3d8f7\WindowsBase.ni.dll
PresentationCore.ni.dll v3.0.6920.0 (vista_rtm_wcp.061020-1904) - D:\WINDOWS\assembly\NativeImages_v2.0.50727_32\PresentationCore\43ad3c3d33ecde4a8169e10459d74c5c\PresentationCore.ni.dll
PresentationFramework.ni.dll v3.0.6920.0 (vista_rtm_wcp.061020-1904) - D:\WINDOWS\assembly\NativeImages_v2.0.50727_32\PresentationFramewo#\459547da83e3d5439c3248ad5031f126\PresentationFramework.ni.dll
msctfime.ime v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\system32\msctfime.ime
ACTXPRXY.DLL v6.00.2900.2180 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\system32\ACTXPRXY.DLL
msi.dll v3.1.4000.2435 - D:\WINDOWS\system32\msi.dll
SXS.DLL v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\system32\SXS.DLL
PresentationUI.ni.dll v3.0.6920.0 (vista_rtm_wcp.061020-1904) - D:\WINDOWS\assembly\NativeImages_v2.0.50727_32\PresentationUI\d9e31f1e5022284aabf61039599048f5\PresentationUI.ni.dll
rsaenh.dll v5.1.2600.2161 (xpsp.040706-1629) - D:\WINDOWS\system32\rsaenh.dll
mscorjit.dll v2.0.50727.42 (RTM.050727-4200) - D:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorjit.dll
PresentationFramework.Luna.ni.dll v3.0.6920.0 (vista_rtm_wcp.061020-1904) - D:\WINDOWS\assembly\NativeImages_v2.0.50727_32\PresentationFramewo#\03277efd2df73840827bc7d84f8fb77b\PresentationFramework.Luna.ni.dll
System.Configuration.ni.dll v2.0.50727.42 (RTM.050727-4200) - D:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.Configuration\fbaebdc90d1c7547ae19f506faae3b94\System.Configuration.ni.dll
System.Xml.ni.dll v2.0.50727.42 (RTM.050727-4200) - D:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.Xml\341d0a29fa94dc46a7112dc0e336d5ae\System.Xml.ni.dll
mslbui.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\system32\mslbui.dll
MilCore.dll v6.0.5840.16386 (vista_rtm_wcp.061020-1904) - D:\WINDOWS\system32\MilCore.dll
PSAPI.DLL v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\system32\PSAPI.DLL
d3d9.dll v5.03.2600.2180 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\system32\d3d9.dll
d3d8thk.dll v5.03.2600.2180 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\system32\d3d8thk.dll
WINMM.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - D:\WINDOWS\system32\WINMM.dll
PresentationNative_v0300.dll v3.0.6920.0 (vista_rtm_wcp.061020-1904) - D:\WINDOWS\system32\PresentationNative_v0300.dll
diasymreader.dll v8.0.50727.42 (RTM.050727-4200) - D:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\diasymreader.dll
Same problem in any other WPF application on my machine.