Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSMS 18.8 crashes when re-docking tabs

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?

like image 901
Variant Fox Avatar asked Feb 08 '21 14:02

Variant Fox


People also ask

Is SSMS 18 backward compatible?

The Latest and Greatest Version 18 iterates off of this and is based on the Visual Studio 2017 shell. Regardless of the edition being used, SQL Server Management Studio only comes in one flavor and boasts backwards compatibility with almost all features from versions 2008 to 2019, including SQL Azure support.

Is SSMS 64 bit or 32 bit?

SSMS is available only as a 32-bit application for Windows. If you need a tool that runs on operating systems other than Windows, we recommend Azure Data Studio.

How do I stop SSMS from crashing when re-docking windows?

In the Ssms.exe.config file, find an XML tag called <AppContextSwitchOverrides>, and APPEND (not replace) the following exactly: Then, save the file with the change you just made. After making this change, SSMS should no longer crash or hang when you manually re-dock windows into the tab bar.

How do I update SSMS 18 x to 18 8?

This update is available through Windows Server Update Services (WSUS). Release 18.8 is applicable to previous versions of SSMS 18. x only. This package will fully upgrade any previous 18. x version. For the release notes for this product, see: SSMS Release Notes.

Where can I find the documentation for SSMS?

Welcome to release 18.8 of Microsoft SQL Server Management Studio (SSMS)! You can find full documentation about this release and previous releases here: SSMS documentation. This update is available through Windows Server Update Services (WSUS).

What is the current version of SSMS Exe?

Application: Ssms.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception.


2 Answers

The "fix" turned out to be this:

First, close all SSMS windows. Next, find your SSMS executable file. Mine was in this location:

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

(If you can't find it, try right-clicking on the shortcut you use to open SSMS and going to Properties --> Open File Location)

Once you have found this file, you will also find a file called Ssms.exe.config in the same folder - open Notepad in Administrator Mode and edit this Ssms.exe.config file.

In the Ssms.exe.config file, 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

Then, save the file with the change you just made.

After making this change, SSMS should no longer crash or hang when you manually re-dock windows into the tab bar.

like image 170
Variant Fox Avatar answered Oct 17 '22 21:10

Variant Fox


Try add this line to the <runtime>-section in the *****.exe.config-File which do you start.

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

I had the same problem with Visual Studio and it helps: Visual Studio 2015 Isolated Shell application crashing when docking Tool window after update to MS KB4601050

Here is is the Microsoft-Statement: https://support.microsoft.com/de-de/topic/kumulatives-update-vom-9-februar-2021-f%C3%BCr-net-framework-3-5-und-4-8-f%C3%BCr-windows-10-version-1809-und-windows-server-version-2019-kb4601055-38aea913-ccd7-bc76-db60-9521318f97cb

like image 30
Biber Avatar answered Oct 17 '22 20:10

Biber