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. Anonymous
    2021-03-05T12:55:55.513+00:00

    thanks it fixes wwooh! I'm alive again


  2. Erland Sommarskog 128.9K Reputation points MVP Volunteer Moderator
    2021-05-14T08:31:21.523+00:00

    It is worth pointing out that this issue has been fixed in SSMS 18.9.1, which you can download here: https://learn.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms. No need to fiddle with manifests anymore.

    So if Zoomy who started sees this thread sees this, it may help people if you accept this Answer in place of Vinnie's original post, which was a life-saver for many, including myself, until 18.9 came out.

    0 comments No comments

  3. Michael Coto 1 Reputation point
    2021-08-18T18:03:28.823+00:00

    From user SamZen, this worked for me. I added the line SamZen references to the bottom of the <runtime> list using Microsoft Studio Code. After I saved it prompted me to 'run as administrator', I did and it worked, no more crashing. I can live my life again.


    SamZen-5230 · Feb 22 2021 at 4:52 AM


    Thanks It worked. I changed the following file.

    C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\Ssms.exe

    with the following xml tag between the <runtime>.

    <runtime>
    <AppContextSwitchOverrides value="Switch.System.Windows.Interop.MouseInput.OptOutOfMoveToChromedWindowFix=true; Switch.System.Windows.Interop.MouseInput.DoNotOptOutOfMoveToChromedWindowFix=true" />
    </runtime>

    0 comments No comments

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.