Unexpected error when opening SSMS 19.1
![OliB](https://us.v-cdn.net/6029854/uploads/defaultavatar/nZUSABQN8JEE0.jpg)
in SQL Prompt
When opening SQL Management Studio I am immediately presented with a dialog informing me of an unexpected error. The error details are 'Object reference not set to an instance of an object.'
![](https://us.v-cdn.net/6029854/uploads/editor/ub/wbpho19xiond.png)
From this point none of the SQL Prompt menu items do anything. I have attempted to uninstall SQL prompt (including rebooting and deleting SQL prompt files from %userprofile%\AppData\Local\Red Gate\SQL Prompt 10.
Whilst I then see SQL prompt has been removed from SSMS, after I reinstall, the next time I open SSMS I get the error once more. This is with rebooting in between the new install.
It feels like I am missing a location where SQL prompt is not completely uninstalled and hitting the same problem. Looking in %userprofile%\AppData\Local\Red Gate\Logs\SQL Prompt 10 I can see the issue is that the formatting style is the issue but am unsure where this is being picked up from.
Any advice as to where this might be?
![](https://us.v-cdn.net/6029854/uploads/editor/ub/wbpho19xiond.png)
From this point none of the SQL Prompt menu items do anything. I have attempted to uninstall SQL prompt (including rebooting and deleting SQL prompt files from %userprofile%\AppData\Local\Red Gate\SQL Prompt 10.
Whilst I then see SQL prompt has been removed from SSMS, after I reinstall, the next time I open SSMS I get the error once more. This is with rebooting in between the new install.
It feels like I am missing a location where SQL prompt is not completely uninstalled and hitting the same problem. Looking in %userprofile%\AppData\Local\Red Gate\Logs\SQL Prompt 10 I can see the issue is that the formatting style is the issue but am unsure where this is being picked up from.
2023-09-27 08:29:56.621 +01:00 [Error] Report error dialog UI shown
System.NullReferenceException: Object reference not set to an instance of an object.
at RedGate.SqlPrompt.Format.Engine.Styles.Saving.StyleFilePathGenerator.GetFilePath(FormattingStyle style)
at RedGate.SqlPrompt.Format.Engine.Styles.Upgrading.StyleFileNamesUpgrader.<Upgrade>d__5.MoveNext()
at RedGate.SqlPrompt.Format.Engine.Styles.Upgrading.StylesUpgrader.Upgrade()
at RedGate.SqlPrompt.CommonUI.Shell.StartUpActions.UpgradeFormattingStyles(ILog logger, IStylesUpgrader stylesUpgrader)
at RedGate.SqlPrompt.CommonUI.Shell.StartUpActions.Run(DevelopmentEnvironment developmentEnvironment)
at RedGate.SqlPrompt.EntryPointCommon.BaseConnect.Initialize(IKernel kernel, IDTEWrapper dte)
at RedGate.SqlPrompt.SsmsCommon.AbstractSsmsConnect.Initialize(IKernel kernel, IDTEWrapper dte)
at RedGate.SqlPrompt.SsmsPackage19.SsmsPackage.<Initialize>b__2_0(ILog logger, IKernel kernel, Action onTabsRestored)
at RedGate.SqlPrompt.EntryPointCommon.Startup.<>c__DisplayClass0_0.<Initialize>b__0()
at RedGate.SqlPrompt.UsageReporting.ErrorReporting.ErrorReporterWithUI.Do(Action action)
Any advice as to where this might be?
Tagged:
Best Answer
-
OliB Posts: 3 New member
Further update, managed to resolve this by uninstalling SQL Search and then removing all RedGate registry keys, everything from C:\Program Files (x86)\Red Gate and everything from C:\Users\myusername\AppData\Local\Red Gate.
I then rebooted and reinstalled. Set the styles folder etc and, after subsequent opens of SSMS no error.
Answers
https://productsupport.red-gate.com/hc/en-us/articles/360019285638--Access-to-the-path-XXXX-is-denied-or-Object-reference-is-not-set-to-instance-of-an-object-