Tag Archives: SSMS

Ssms 18.6 – exiting on start

So recently, SSMS started exiting on startup for me. It would display the splash screen, and then about the time the connection dialog was to show, it would just exit. Initially I tried repair, then re-installing, erasing its section in the registry, and the files in AppData/Local, nothing worked.

I checked the Windows Event log and found the following exception:

Application: Ssms.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentNullException
   at System.Windows.Forms.ComboBox+ObjectCollection.AddInternal(System.Object)
   at System.Windows.Forms.ComboBox+ObjectCollection.Add(System.Object)
   at Microsoft.SqlServer.Management.UI.ConnectionDlg.LoginControl.UpdateServerInstanceMruOnly()
   at Microsoft.SqlServer.Management.UI.ConnectionDlg.LoginControl.UpdateServerInstanceMruAndValue()
   at Microsoft.SqlServer.Management.UI.ConnectionDlg.LoginControl.OnSTIndexChange(System.Object, System.EventArgs)
   at System.Windows.Forms.ComboBox.OnSelectedIndexChanged(System.EventArgs)
   at System.Windows.Forms.ComboBox.set_SelectedIndex(Int32)
   at System.Windows.Forms.ComboBox.set_SelectedItem(System.Object)
   at Microsoft.SqlServer.Management.UI.ConnectionDlg.LoginControl.InitFromLastUsedServerType()
   at Microsoft.SqlServer.Management.UI.ConnectionDlg.ConnectionDialog.DoOneTimeInitialization()
   at Microsoft.SqlServer.Management.UI.ConnectionDlg.ConnectionDialog.OnVisibleChanged(System.EventArgs)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ShellConnectionDialog.OnVisibleChanged(System.EventArgs)
   at System.Windows.Forms.Control.WmShowWindow(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.ScrollableControl.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.Form.WmShowWindow(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.Form.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.Control+ControlNativeWindow.OnMessage(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.Control+ControlNativeWindow.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr, Int32, IntPtr, IntPtr)

This made me think, the error appears to be on loading a combo box, perhaps the combo that has the connections. So where are the list of connections stored? After some googling I found this stack overflow answer Where does SSMS store its server names

So for 18.x, this is in C:\Users\[USERNAME]\AppData\Roaming\Microsoft\SQL Server Management Studio\18.0\UserSettings.xml

I renamed the file to UserSettings.xml.old, started SSMS and voila!, it created a new user settings file and I was good to go

Running both XML files through Beyond Compare, I found this section which I believe to be the most likely the culprit:

tempsnip.png