When I un-dock a tab in SQL Server Management Studio and later attempt to re-dock it, SSMS crashes. This happens every time, and I can reproduce the problem at will. All I have to do is un-dock a tab (let's say, in order to view two SQL queries in different tabs side-by-side) and then attempt to re-dock it, and SSMS will crash. Looking at the Event Viewer, I find two successive error messages each time the crash happens, the first with its Source set to ".NET Runtime" and the second with its source set to "Application Error" in the Event Viewer:
Message #1:
Application: Ssms.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.NullReferenceException at System.Windows.Interop.HwndMouseInputProvider.HasCustomChrome(System.Windows.Interop.HwndSource, RECT ByRef) at System.Windows.Interop.HwndMouseInputProvider.GetEffectiveClientRect(IntPtr) at System.Windows.Interop.HwndMouseInputProvider.PossiblyDeactivate(IntPtr, Boolean) at System.Windows.Interop.HwndMouseInputProvider.Dispose() at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr, MS.Internal.Interop.WindowMessage, IntPtr, IntPtr, Boolean ByRef) at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef) at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
Message #2:
Faulting application name: Ssms.exe, version: 2019.150.18369.0, time stamp: 0x5fd317a3 Faulting module name: PresentationCore.ni.dll, version: 4.8.4320.0, time stamp: 0x5fc81198 Exception code: 0xc0000005 Fault offset: 0x0076c044 Faulting process id: 0x166c Faulting application start time: 0x01d6fc1a384c50f7 Faulting application path: C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Ssms.exe Faulting module path: C:\Windows\assembly\NativeImages_v4.0.30319_32\PresentationCore\627e2c47709994c2c1f8fd2e1228d567\PresentationCore.ni.dll Report Id: 1b2fa46b-b60c-4517-bd91-1d4de7324b26 Faulting package full name: Faulting package-relative application ID:
Has anyone else experienced this issue and found a fix or a workaround for it?
This was fixed in SSMS 18.9, released on April 15, 2021. Fiddling with the config file is no longer required.
Release Notes for 18.9