SQL Prompt Formatter - Command Line - Error

RoilRoil Posts: 3 New member
Hello,

I am trying to run SQL Prompt from command line, and I am getting this error:

C:\Users\sauls>SqlPrompt.Format.CommandLine.exe --i-agree-to-the-eula -p C:\Users\sauls\Desktop\test.txt

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
   at System.MemoryExtensions.AsSpan(String text)
   at System.CommandLine.Parsing.StringExtensions.TrySplitIntoSubtokens(String arg, String& first, String& rest)
   at System.CommandLine.Parsing.StringExtensions.Tokenize(IReadOnlyList`1 args, CommandLineConfiguration configuration, Boolean inferRootCommand)
   at System.CommandLine.Parsing.Parser.Parse(IReadOnlyList`1 arguments, String rawInput)
   at RedGate.SqlPrompt.Formatting.Bulk.CommandLine.Program.Main(String[] args)

I followed your instructions located here: https://documentation.red-gate.com/sp/features-available-only-in-sql-toolbelt-essentials-and-sql-toolbelt/bulk-operations/bulk-operations-via-the-command-line#:~:text=The%20command%20line%20formatter%20can,Format., but that does not provide any information for errors encountered.

Can you please provide some guidance on how to resolve this error?

Thanks!
Tagged:

Answers

  • Hi there,

    Thank you for reaching out and I apologize that you are running into issues with SQL Prompt.

    This is a known issue by the development team and they are currently looking at it.
    I will keep you updated on the situation.

    Kind Regards,
    David Kim
    Product Support Engineer
  • RoilRoil Posts: 3 New member
    FYI. I installed the newest version of SQL Prompt this morning, and the error message has changed to the following:

    Error encountered during format: Could not load file or assembly 'System.ValueTuple, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
  • Hi there,

    Thank you for the update.

    Can you please send over your log files so that I can take a look at them?
    You can find your log files by following the steps in this documentation: https://documentation.red-gate.com/sp/troubleshooting/finding-the-sql-prompt-log-files

    Kind Regards,
    David Kim
    Product Support Engineer

  • RoilRoil Posts: 3 New member
    I tried the following:
    1. Enabled Verbose Logging within SSMS
    2. Ran SQL Prompt formatter from command line with SSMS open.
    3. Went to SSMS and clicked View Log (shown below)
    4. Went to the %LOCALAPPDATA%\Red Gate\Logs\SQL Prompt 10 directory to see if that caught it
    5. There was only one log file there, but it has not been modified since April. (shown below)

    Log from SSMS:

    2022-08-03 08:34:48.573 -04:00 [Information] Logging level set to 'Information'
    2022-08-03 08:34:50.924 -04:00 [Information] Launching package entry point Ssms18 (version 15.0.18424.0) for SQL Prompt 10.12.3.28623.
    2022-08-03 08:34:51.228 -04: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: 
    Current culture: en-US
    Current UI culture: en-US
    2022-08-03 08:34:53.137 -04:00 [Information] Current license: Enabled = True, Activated = True, Features = [None]
    2022-08-03 08:34:55.638 -04:00 [Information] SqlPromptApplication initialised (startup took 0:0:0.0)

    Log from %LOCALAPPDATA%\Red Gate\Logs\SQL Prompt 10:

    2022-04-06 07:24:00.780 -04:00 [Information] Logging level set to 'Information'
    2022-04-06 07:24:01.145 -04:00 [Error] Report error dialog UI shown
    System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
    File name: 'Microsoft.Bcl.AsyncInterfaces, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
       at RedGate.SqlPrompt.Platform.Client.HttpClientConfiguration.Configure(IKernel kernel)
       at RedGate.SqlPrompt.Platform.Client.PlatformModule.Load()
       at Ninject.Modules.NinjectModule.OnLoad(IKernel kernel)
       at Ninject.KernelBase.Load(IEnumerable`1 m)
       at RedGate.SqlPrompt.EntryPointCommon.NinjectSetup.Create()
       at RedGate.SqlPrompt.EntryPointCommon.Startup.<>c__DisplayClass0_0.<Initialize>b__0()
       at RedGate.SqlPrompt.UsageReporting.ErrorReporting.ErrorReporterWithUI.Do(Action action)

    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].

  • Hi Roil,

    Thank you for the update.
    Can you try uninstalling the current version of SQL Prompt from the Control panel and then reinstall using the below installer: https://download.red-gate.com/checkforupdates/SQLPrompt/SQLPrompt_10.12.3.28623.exe

    Kind Regards,
    David Kim
    Product Support Engineer


  • GregoryStellarGregoryStellar Posts: 1 New member
    edited January 2, 2023 11:22AM
    I had a similar problem and read the documentation

    https://documentation.red-gate.com/sp/features-available-only-in-sql-toolbelt-essentials-and-sql-toolbelt/bulk-operations/bulk- operations-via -the-command-line#:~:text=Command%20command%20line%20formatter%20can,Format., ! But nothing worked for me after that, I just rebooted my system 3 times and everything worked for me without any changes! Thanks for the support but I am often busy with plastic surgery https://celebshistory.com Nose Job Lip Filler and it saved me a lot of time!











Sign In or Register to comment.