SQL Prompt has stopped working in SSMS v18.9

biancabianca Posts: 4 New member
edited May 11, 2021 9:34AM in SQL Prompt
Hello,

I've recently upgraded my SSMS to the most recent version (18.9.1) and I've noticed that SQL Prompt doesn't seem to work anymore. Whenever I open SSMS, I get this error: "Object reference not set to an instance of an object."

I've got SQL Prompt 10 installed currently. I've tried downgrading SSMS and also SQLPrompt but with no luck.

Has anyone else come across this problem? Any help would be much appreciated.
Tagged:

Answers

  • lenlen Posts: 3 Bronze 1
    I have the same issue.  Cant seem to find out what the issue is
  • Hi @bianca, @len

    Thanks for getting in touch and so sorry to hear you've run into this issue!

    Unfortunately, it's a generic error message which isn't very helpful to narrow down the cause of the issue. Could you restart SSMS and leave your email address in the email filed and then send the error report across?


    Kind regards

    Victoria Wiseman | Redgate Software
    Have you visited our Help Center?
  • biancabianca Posts: 4 New member
    Hi, Victoria. Thank you for getting in touch. I've submitted an error report just now.
  • Dan_JDan_J Posts: 465 Silver 2

    Thank you for reaching out. I am sorry to hear tat you have run into a problem with SQL Prompt.

    So that I can troubleshoot this further, would it be possible to get a copy of the log files? They can be found here: https://documentation.red-gate.com/sp/troubleshooting/finding-the-sql-prompt-log-files

    Kind regards

    Dan Jary | Redgate Software
    Have you visited our Help Center?
  • biancabianca Posts: 4 New member
    Hi, Dan. Thank you for trying to help. The Show Log and Enable Verbose logging seem completely disabled for me in SSMS. I was able to get to the log files however. 

    This is what I can see in one of the most recent log files:

    2021-05-13 20:54:17.145 +01:00 [Information] Launching package entry point Ssms18 (version 15.0.18384.0) for SQL Prompt 10.6.10.19533.
    2021-05-13 20:54:17.253 +01:00 [Information] Starting new SQL Prompt 10.6.10.19533 editor session
    2021-05-13 20:54:18.299 +01:00 [Information] BaseConnect(RedGate.SQLPrompt.SsmsPackage18.ConnectAdapter) constructed successfully
    2021-05-13 20:54:18.505 +01:00 [Information] Initialising DTE and AddIn connections.
    ***
    DTE.FullName = C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Ssms.exe, DTE.Version = 2019.0150,
    DTE.CommandLine = ,
    ***
    AddIn.Name = SQL Prompt, AddIn.ProgID = RedGate.SQLPrompt.Package,
    AddIn.Description = SQL Prompt
    2021-05-13 20:54:18.506 +01:00 [Information] Current culture en-US
    2021-05-13 20:54:18.506 +01:00 [Information] AddIn.SatelliteDllPath = null
    2021-05-13 20:54:18.959 +01:00 [Error] Report error dialog UI shown
    System.NullReferenceException: Object reference not set to an instance of an object.
       at Format.Engine.Styles.Saving.StyleFilePathGenerator.GetFilePath(FormattingStyle style)
       at Format.Engine.Styles.Upgrading.StyleFileNamesUpgrader.<Upgrade>d__5.MoveNext()
       at Format.Engine.Styles.Upgrading.StylesUpgrader.Upgrade()
       at RedGate.SQLPrompt.CommonVS.BaseConnect.UpgradeFormattingStyles()
       at RedGate.SQLPrompt.CommonVS.BaseConnect.Initialize(DTE2 dte, AddIn addInInstance)
       at RedGate.SQLPrompt.SSMSUI.AbstractSsmsConnect.Initialize(DTE2 dte, AddIn addInInstance)
       at RedGate.SQLPrompt.SSMSUI.AbstractSsmsConnect.VsPackageInitialize(DTE dte)
       at RedGate.SQLPrompt.SsmsPackage18.SQLPromptSsmsPackage18.<>c__DisplayClass1_0.<Initialize>b__0()
       at RedGate.SQLPrompt.UsageReporting.ErrorReporting.ErrorReporterWithUI.Do(Action action)

    This doesn't seem to have a lot of detail but in another earlier log file I can see more info:

    2021-04-09 13:13:31.564 +01:00 [Information] Launching package entry point Ssms18 (version 15.0.18338.0) for SQL Prompt 10.6.6.18829.
    2021-04-09 13:13:31.731 +01:00 [Information] Starting new SQL Prompt 10.6.6.18829 editor session
    2021-04-09 13:13:32.645 +01:00 [Information] BaseConnect(RedGate.SQLPrompt.SsmsPackage18.ConnectAdapter) constructed successfully
    2021-04-09 13:13:32.928 +01:00 [Information] Initialising DTE and AddIn connections.
    ***
    DTE.FullName = C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Ssms.exe, DTE.Version = 2019.0150,
    DTE.CommandLine = ,
    ***
    AddIn.Name = SQL Prompt, AddIn.ProgID = RedGate.SQLPrompt.Package,
    AddIn.Description = SQL Prompt
    2021-04-09 13:13:32.928 +01:00 [Information] Current culture en-US
    2021-04-09 13:13:32.928 +01:00 [Information] AddIn.SatelliteDllPath = null
    2021-04-09 13:13:33.343 +01:00 [Error] Report error dialog UI shown
    System.NullReferenceException: Object reference not set to an instance of an object.
       at Format.Engine.Styles.Saving.StyleFilePathGenerator.GetFilePath(FormattingStyle style)
       at Format.Engine.Styles.Upgrading.StyleFileNamesUpgrader.<Upgrade>d__5.MoveNext()
       at Format.Engine.Styles.Upgrading.StylesUpgrader.Upgrade()
       at RedGate.SQLPrompt.CommonVS.BaseConnect.UpgradeFormattingStyles()
       at RedGate.SQLPrompt.CommonVS.BaseConnect.Initialize(DTE2 dte, AddIn addInInstance)
       at RedGate.SQLPrompt.SsmsPackage18.ConnectAdapter.Initialize(DTE2 dte, AddIn addInInstance)
       at RedGate.SQLPrompt.SsmsPackage18.ConnectAdapter.VsPackageInitialize(DTE dte)
       at RedGate.SQLPrompt.SsmsPackage18.SQLPromptSsmsPackage18.<>c__DisplayClass1_0.<Initialize>b__0()
       at RedGate.SQLPrompt.UsageReporting.ErrorReporting.ErrorReporterWithUI.Do(Action action)
    2021-04-09 13:13:38.800 +01:00 [Error] Error during collection of environmental data for usage reporting
    System.IO.FileNotFoundException: Could not load file or assembly 'System.CodeDom, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
    File name: 'System.CodeDom, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
       at RedGate.Usage.Client.Payload.SessionStarted.DotNetCurrentDataSource.GetCSharpVersion()
       at RedGate.Usage.Client.Payload.PayloadDataSourceBase.GetDataSafely[T](Func`1 getData)

    WRN: Assembly binding logging is turned OFF.
    To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
    Note: There is some performance penalty associated with assembly bind failure logging.
    To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

    2021-04-09 13:13:38.902 +01:00 [Error] Error during collection of environmental data for usage reporting
    System.IO.FileNotFoundException: Could not load file or assembly 'System.Security.Principal.Windows, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
    File name: 'System.Security.Principal.Windows, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
       at RedGate.Usage.Client.Payload.SessionStarted.Windows.SecurityDataSource.GetTokenElevationType()
       at RedGate.Usage.Client.Payload.PayloadDataSourceBase.GetDataSafely[T](Func`1 getData, T errorValue)

    WRN: Assembly binding logging is turned OFF.
    To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
    Note: There is some performance penalty associated with assembly bind failure logging.
    To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
  • Dan_JDan_J Posts: 465 Silver 2
    Hi there @bianca

    Thank you very much for providing that log information.

    Looking at it, I do wonder if this is being caused by an issue with the registry keys that manage the style and snippets folders... 

    I think it might be worth attempting a full reinstall of SQL Prompt before we look at other ways to resolve this issue. If you don't mind trying this, please can you follow these steps:

    - Take a backup of your Snippet and Style files
    - Use Revo Uninstaller (free) to remove SQL Prompt and all of it's residual files. Revo Uninstaller can be downloaded here: https://www.revouninstaller.com/revo-uninstaller-free-download/
    - Download and install the latest version of SQL Prompt (https://download.red-gate.com/checkforupdates/SQLPrompt/SQLPrompt_10.6.12.20269.exe)

    I do hope this helps. Please let me know if this does or does not resolve this issue you are seeing.



    Kind regards

    Dan Jary | Redgate Software
    Have you visited our Help Center?
  • biancabianca Posts: 4 New member
    edited May 25, 2021 3:30PM
    Hi, Dan. Sorry to reply so late. I've used the Revo Uninstaller to uninstall SQL Prompt and removed any leftover files. There were some registry keys that were left behind. It works again now. Thank you very much for your help.
  • Dan_JDan_J Posts: 465 Silver 2

    No need to apologize! I'm glad SQL Prompt is now working for you!

    Kind regards

    Dan Jary | Redgate Software
    Have you visited our Help Center?
  • VickiBVickiB Posts: 1 New member
    I also have the same issue. Uninstalling SSMS and reinstalling it hasn't done the trick for me.
  • Hi @VickiB

    I'm sorry you are seeing this issue with SQL Prompt!

    I have replied to you directly from a ticket we have logged for this issue.
    Kind regards

    Dan Jary | Redgate Software
    Have you visited our Help Center?
Sign In or Register to comment.