SSMS 18.8 crashes when re-docking tabs

Zoomy 261 Reputation points
2021-02-08T14:24:01.643+00:00

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 (see the pasted messages below).

Please fix this! It's wreaking havoc on my usual workflow. Thanks.

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)

SQL Server | Other
0 comments No comments
{count} votes

Answer accepted by question author
  1. Vinnie Amir 376 Reputation points
    2021-02-15T21:58:59.813+00:00

    Fix:

    1. Close all SSMS windows, and find your SQL Mgt Studio EXE file, mine was in:

    C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE

    If you cant find it, right click your shortcut you use to open SSMS and go Properties > Open File Location

    1. Once you have found this, you will also find a file called "Ssms.exe.config, open up a Notepad in Administrator Mode, and edit this file
    2. You will then need to find an xml tag called <AppContextSwitchOverrides>, and APPEND (not replace) the following exactly:

    ;Switch.System.Windows.Interop.MouseInput.OptOutOfMoveToChromedWindowFix=true; Switch.System.Windows.Interop.MouseInput.DoNotOptOutOfMoveToChromedWindowFix=true

    1. And that is it. You will now avoid this nasty crash

    https://support.microsoft.com/en-us/topic/february-9-2021-kb4601060-cumulative-update-for-net-framework-3-5-and-4-7-2-for-windows-10-version-1809-and-windows-server-version-2019-b240d07e-639f-d708-98c9-0cbe443176aa

    57 people found this answer helpful.

11 additional answers

Sort by: Most helpful
  1. VladyslavQA 1 Reputation point
    2021-02-09T14:10:50.26+00:00

    I got the same problem, reinstall VS reset the settings, log out of the account, nothing helps. Cannot move tabs, test window tab cannot be docked to program window

    0 comments No comments

  2. Justin G 1 Reputation point
    2021-02-09T19:04:47.76+00:00

    Hi @Zoomy , this is also started suddenly happening to me in VS2017, which lead me to believe a windows update was to blame rather than the software itself.

    Please see: https://developercommunity.visualstudio.com/content/problem/1323017/unexpected-vs-crash-when-docking-or-splitting-wind.html

    MS has identified KB4598301 as the root cause and offers some work arounds for VS, which may also apply to SMSS.

    0 comments No comments

  3. Zoomy 261 Reputation points
    2021-02-10T14:34:12.52+00:00

    Thanks for the answers. I suspected it might be the result of a recent Windows Update, as you've suggested. Unfortunately, I don't see any of the exact KB* updates you mention on my machine. I'm running Windows Server 2019 Standard, Version 10.0.17763 Build 17763, if that helps. Are the update numbers different for Windows Server? Regardless, I did another update just now hoping that a patch might have made it into the latest package of updates, but to no avail - SSMS still crashes when I manually un-dock and then attempt to re-dock a tab.


  4. Zoomy 261 Reputation points
    2021-02-15T23:13:40.773+00:00

    Thanks also to @Erland Sommarskog and @VladyslavQA for their replies. It's quite possible that your suggestions would've also fixed the issue, now that I've had a chance to read the entire thread. Your help is greatly appreciated.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.