SSMS automatically restarts after I close it
irisoft
Posts: 13 Bronze 2
Hello.
When I close SSMS (latest - 19.3) it automatically restarts instead of staying closed. In Windows Logs I see 3 errors:
Warning 1 - SSMS Integration Pack 3
ngWrapper.LogManager
Error 2 - .NET Runtime
Error 3 - Application Error
When I close SSMS (latest - 19.3) it automatically restarts instead of staying closed. In Windows Logs I see 3 errors:
Warning 1 - SSMS Integration Pack 3
ngWrapper.LogManager
#1:Unhandled Exception: Object reference not set to an instance of an object.. IsTerminating : True
System.NullReferenceException: Object reference not set to an instance of an object.
at RedGate.SQLSourceControl.Engine.LinkedDatabaseStore.TryGetLinkedDatabase(DatabaseId databaseId, ILinkedDatabase& linkedDatabase)
at RedGate.SQLSourceControl.Engine.Diff.LinkedDatabaseConfigStore.TryGetLinkedDatabase(DatabaseId databaseId, ILinkedDatabase& linkedDatabase)
at RedGate.SQLSourceControl.Engine.Diff.LinkedDatabaseConfigStore.TryGetLinkedDatabase(DatabaseId databaseId, ILinkedDatabaseDetails& linkedDatabase)
at RedGate.SQLSourceControl.Engine.Diff.Controller.TryGetLinkedDatabase(DatabaseId databaseId, ILinkedDatabaseDetails& linkedDatabase)
at RedGate.SQLSourceControl.CommonUI.DatabaseViewController.TryGetCurrentLinkedDatabase(ILinkedDatabaseDetails& linkedDatabase)
at RedGate.SQLSourceControl.CommonUI.DatabaseViewController.get_IsFlywayProject()
at RedGate.SQLSourceControl.CommonUI.ViewController.get_IsFlywayProject()
at RedGate.SQLSourceControl.CommonUI.Controls.DatabaseAndBranchNameControl.UpdateFlywayWarningVisibility()
at RedGate.SQLSourceControl.CommonUI.Controls.Commit.ToCommitTabControl.EnableControls(Boolean haveSelectedChanges)
at RedGate.SQLSourceControl.CommonUI.Controls.Commit.ToCommitTabControl.OperationChanged(Object sender, EventArgs e)
at RedGate.SQLSourceControl.CommonUI.Controls.ChangeSetViewerControl.RefreshChangeSet()
at RedGate.SQLSourceControl.CommonUI.Controls.ChangeSetViewerControl.ManagedVisibleChanged(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnVisibleChanged(EventArgs e)
at System.Windows.Forms.ScrollableControl.OnVisibleChanged(EventArgs e)
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Error 2 - .NET Runtime
Application: Ssms.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
at RedGate.SQLSourceControl.Engine.LinkedDatabaseStore.TryGetLinkedDatabase(RedGate.SQLSourceControl.Engine.Model.Comparison.DatabaseId, RedGate.SQLSourceControl.Engine.Interfaces.Comparison.ThreeDatabase.ILinkedDatabase ByRef)
at RedGate.SQLSourceControl.Engine.Diff.LinkedDatabaseConfigStore.TryGetLinkedDatabase(RedGate.SQLSourceControl.Engine.Model.Comparison.DatabaseId, RedGate.SQLSourceControl.Engine.Interfaces.Comparison.ThreeDatabase.ILinkedDatabase ByRef)
at RedGate.SQLSourceControl.Engine.Diff.LinkedDatabaseConfigStore.TryGetLinkedDatabase(RedGate.SQLSourceControl.Engine.Model.Comparison.DatabaseId, RedGate.SQLSourceControl.Engine.Interfaces.Comparison.ThreeDatabase.ILinkedDatabaseDetails ByRef)
at RedGate.SQLSourceControl.Engine.Diff.Controller.TryGetLinkedDatabase(RedGate.SQLSourceControl.Engine.Model.Comparison.DatabaseId, RedGate.SQLSourceControl.Engine.Interfaces.Comparison.ThreeDatabase.ILinkedDatabaseDetails ByRef)
at RedGate.SQLSourceControl.CommonUI.DatabaseViewController.TryGetCurrentLinkedDatabase(RedGate.SQLSourceControl.Engine.Interfaces.Comparison.ThreeDatabase.ILinkedDatabaseDetails ByRef)
at RedGate.SQLSourceControl.CommonUI.DatabaseViewController.get_IsFlywayProject()
at RedGate.SQLSourceControl.CommonUI.ViewController.get_IsFlywayProject()
at RedGate.SQLSourceControl.CommonUI.Controls.DatabaseAndBranchNameControl.UpdateFlywayWarningVisibility()
at RedGate.SQLSourceControl.CommonUI.Controls.Commit.ToCommitTabControl.EnableControls(Boolean)
at RedGate.SQLSourceControl.CommonUI.Controls.Commit.ToCommitTabControl.OperationChanged(System.Object, System.EventArgs)
at RedGate.SQLSourceControl.CommonUI.Controls.ChangeSetViewerControl.RefreshChangeSet()
at RedGate.SQLSourceControl.CommonUI.Controls.ChangeSetViewerControl.ManagedVisibleChanged(System.Object, System.EventArgs)
at System.EventHandler.Invoke(System.Object, System.EventArgs)
at System.Windows.Forms.Control.OnVisibleChanged(System.EventArgs)
at System.Windows.Forms.ScrollableControl.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.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)
Error 3 - Application Error
Faulting application name: Ssms.exe, version: 2024.190.3.4, time stamp: 0x659e4c7f
Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000
Exception code: 0xc0000005
Fault offset: 0x3f23775f
Faulting process id: 0x0x5F08
Faulting application start time: 0x0x1DA4AE3A114B8A6
Faulting application path: C:\Program Files (x86)\Microsoft SQL Server Management Studio 19\Common7\IDE\Ssms.exe
Faulting module path: unknown
Report Id: 48740288-d50b-4570-b00a-61419766be6f
Faulting package full name:
Faulting package-relative application ID:
It appears to be linked to SQL Source Control. I have the latest version of it (SQLSourceControl_7.7.1.18312.exe). I also have the latest version of SQL Prompt. I uninstalled/reinstalled SQL Source Control.
The weird restart happens when I have at least 2 instances of SSMS opened and I close one of them that had a procedure (or any object) opened.
I always have multiple SSMS instances opened. If I close more instances all of them are restarting. It's very annoying.
Thank you.
Later edit: it happens even if I have only one instance of SSMS with a procedura opened even if I don't modify anything and that database is not under source control.
It appears to be linked to SQL Source Control. I have the latest version of it (SQLSourceControl_7.7.1.18312.exe). I also have the latest version of SQL Prompt. I uninstalled/reinstalled SQL Source Control.
The weird restart happens when I have at least 2 instances of SSMS opened and I close one of them that had a procedure (or any object) opened.
I always have multiple SSMS instances opened. If I close more instances all of them are restarting. It's very annoying.
Thank you.
Later edit: it happens even if I have only one instance of SSMS with a procedura opened even if I don't modify anything and that database is not under source control.
Tagged:
Answers
Thanks for all of the information.
I've tried replicating this on a fresh install of SSMS 19.3 as well as installing SQL Prompt and SQL Source Control. I opened multiple stored procedures across the two instances I had open, but upon closing, nothing strange was occurring for me.
I can't say exactly why you're having this issue, but it might be worth trying to cleanly uninstall SQL Source Control as well as SSMS. This can help ensure that all components are correctly removed. Afterwards, try restarting your machine and cleanly installing SSMS 19.3 and the Redgate products.
Kind regards,
Kurt McCormick
Product Support Engineer, Redgate
Need help? Take a look at our Help Center
Thank you for your answer. I uninstalled all Redgate products and SSMS, restarted and installed everything back. The result is the same.
I uninstalled SQL Source Control 7.7.1 and installed 7.6.34 - same error. I installed version 7.6.28 and it works. So, the error appeared somewhere between 7.6.28 and 7.6.34. I don't have all the versions in between (probably missed them in december).
If you can check the changes between these versions related to the error in the first post (RedGate.SQLSourceControl.Engine.LinkedDatabaseStore.TryGetLinkedDatabase) maybe you can add a try-catch or a null check or something to prevent that exception.
For now, I will stay on version 7.6.28 and I will try on a future version to see if the error disappears.
Thank you.
Ironically, because i'm now on 19.3 and having to uninstall and re-install redgate products to get them to show in the new version, I am prompted to close SSMS to allow the update, but after you close SSMS you actually see the second SSMS instance in the 'Quit applications' screen. And have to go and close that as well before being able to install.
Is there a fix in the works for this issue raised at the start of this year?
Today I upgraded from SSMS 19.3 to SSMS 20.1 (Windows 11 box). Although SSMS is supposed to import options and customisations, it definitely doesn't do them all - including toolbars. I like my toolbars to have my most used tools and not filled with stuff I don't want.
So I modified the toolbars to the way I wanted, then exited out of SSMS. Unfortunately, SSMS automatically restarted (again) and the toolbars had all reverted (or, more specifically, nothing had been saved).
After various fumbling about, I found a workaround how to stop this happening:
The object explorer should be empty. This will stop SSMS restarting, and also allow you to save changes to toolbars (and perhaps other things).
(Note that it seems to be OK if you didn't actually open any databases, but if you have opened a database, then disconnecting from the server, before exiting SSMS, allows you to exit without restarting).
Is there a plan to fix this?
Is there any response from Redgate on this issue?
Very annoying!
SeanB said:
Software Engineer
NTS Data Services, LLC
Software Engineer
NTS Data Services, LLC
I have submitted a bug to Red-Gate with this same error.
Software Engineer
NTS Data Services, LLC
Software Engineer
NTS Data Services, LLC
Redgate Software
Please let us know if this helps!
Kind regards
Dan Calver | Redgate Software
Have you visited our Help Center?
Software Engineer
NTS Data Services, LLC