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
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,778 questions
0 comments No comments
{count} votes

Accepted answer
  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. Erland Sommarskog 101.4K Reputation points MVP
    2021-02-09T20:08:42.027+00:00

    I got a tip from an MVP colleague that a KB update could be a problem just like Justin suggests. It appears that there are two of them, KB4598299 and KB4598301. I have KB4598299 on two machines, and I see the crash on both. I also get the same crash in Visual Studio 2017 - quite expected, since SSMS uses the VS2017 shell.

    I uninstalled KB4598299 on of the machines, and after the uninstall, I don't get the crash, so that appears to be the solution.

    1 person found this answer helpful.

  2. Erland Sommarskog 101.4K Reputation points MVP
    2021-02-10T22:33:24.607+00:00

    I don't know for sure, but I assume that there are different KBs for server OSs.

    In any case, it is the .NET update for 2021-02 you want to get rid of. The final one came yesterday, and then there was a preview last week.

    I had a little trouble finding these myself, but they are hiding under Other Updates in the View Update History.

    1 person found this answer helpful.
    0 comments No comments

  3. Erland Sommarskog 101.4K Reputation points MVP
    2021-02-08T23:01:27.29+00:00

    I was able to repeat that. On the first attempt.

    You can report bugs on https://feedback.azure.com/forums/908035-sql-server.


  4. CathyJi-MSFT 21,096 Reputation points Microsoft Vendor
    2021-02-09T05:50:22.84+00:00

    Hi @Zoomy ,

    It works well in my environment, I am using SSMS 18.8. On the menu bar, select Window, then Reset Window Layout. This will place object explorer to its original position.

    Or right click on object explorer, now you can see an option called "Dock", select "Dock". By this object explorer comes to normal position as earlier.

    For SQL query windows tab, it also works well in my environment, I can move them back as earlier.

    Did you try to use SSMS 17.9.1 or SSMS 18.7.1? you can get them from here.

    If I misunderstood your issue, please let me know.


    If the response is helpful, please click "Accept Answer", thank you.