Hi, getting this exception on startup.
Failed to import snippets from SSMS: Error: Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.Text.Json.JsonException: '<' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0.
---> System.Text.Json.JsonReaderException: '<' is an invalid start of a value. LineNumber: 0 | BytePositionInLine: 0.
at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan`1 bytes)
at System.Text.Json.Utf8JsonReader.ConsumeValue(Byte marker)
at System.Text.Json.Utf8JsonReader.ReadFirstToken(Byte first)
at System.Text.Json.Utf8JsonReader.ReadSingleSegment()
at System.Text.Json.Utf8JsonReader.Read()
at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& readStack)
--- End of inner exception stack trace ---
at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& readStack, JsonReaderException ex)
at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& readStack)
at System.Text.Json.JsonSerializer.ReadCore(Type returnType, JsonSerializerOptions options, Utf8JsonReader& reader)
at System.Text.Json.JsonSerializer.Deserialize(String json, Type returnType, JsonSerializerOptions options)
at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
at RedGate.SqlPrompt.SnippetConverter.Ssms.Json.SsmsJsonSnippetSerializer.Deserialize(Stream stream) in \D:\BuildAgentB\work\dc5fefc0dc183d00\SnippetConverter\Ssms\Json\SsmsJsonSnippetSerializer.cs:line 12
at RedGate.SqlPrompt.SnippetConverter.Ssms.SsmsSnippets.LoadSsmsSnippet(String fileName) in \D:\BuildAgentB\work\dc5fefc0dc183d00\SnippetConverter\Ssms\SsmsSnippets.cs:line 33
at System.Linq.Enumerable.SelectArrayIterator`2.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator`1.ToList()
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at RedGate.SqlPrompt.SnippetConverter.SsmsToAdsSnippetConverter.Convert(String ssmsSnippetsFolder, String adsSnippetsFile) in \D:\BuildAgentB\work\dc5fefc0dc183d00\SnippetConverter\SsmsToAdsSnippetConverter.cs:line 21
at RedGate.SqlPrompt.SnippetConverter.Program.Run(Logger logger, Options options) in \D:\BuildAgentB\work\dc5fefc0dc183d00\SnippetConverter\Program.cs:line 79
at RedGate.SqlPrompt.SnippetConverter.Program.<>c__DisplayClass1_0.<Main>b__0(Options options) in \D:\BuildAgentB\work\dc5fefc0dc183d00\SnippetConverter\Program.cs:line 34
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.Delegate.DynamicInvoke(Object[] args)
at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass23_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass27_0.<<UseVersionOption>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass25_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__24_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass11_0.<<UseDebugDirective>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__10_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<<UseExceptionHandler>b__0>d.MoveNext()
From the log SnippetConverter202109161644.log
2021-09-16 16:44:11.385 -04:00 [INF] ------------------------------------------------------------------------------------------------------------------------
2021-09-16 16:44:11.541 -04:00 [INF] Supplied locations:
SSMS: Default
ADS: Default
2021-09-16 16:44:11.542 -04:00 [INF] Finding default SSMS snippets location
2021-09-16 16:44:11.548 -04:00 [INF] Default SSMS snippets location: C:\Users\ersabine\AppData\Local\Red Gate\SQL Prompt 10\Snippets
2021-09-16 16:44:11.548 -04:00 [INF] Finding default ADS snippets location
2021-09-16 16:44:11.549 -04:00 [INF] Default ADS snippets location: C:\Users\ersabine\AppData\Roaming\azuredatastudio\User\Snippets\sql.json
2021-09-16 16:44:11.549 -04:00 [INF] Converting snippets
Versions:
ADS: 1.32.0
SQL Prompt: 10.6.19.22009
ADS Sql Prompt: 0.2.8
Answers
I'm sorry you are experiencing this issue with SQL Prompt! Thanks for reaching out to us on this.
We are aware that there is a bug in relation to the importing of snippets in ADS that is affecting a small number of customers. Our development team are working on a fix for this.
Also, the latest version of the ADS addin requires a fairly recent version of SQL Prompt to work properly. As an initial action on this, please can you update to the very latest version of SQL Prompt to see if you continue to experience this issue?
Version 10.8.2 can be downloaded direction from here: https://download.red-gate.com/checkforupdates/SQLPrompt/SQLPrompt_10.8.2.23489.exe
Dan Jary | Redgate Software
Have you visited our Help Center?
Dan Jary | Redgate Software
Have you visited our Help Center?
Dan Jary | Redgate Software
Have you visited our Help Center?
I have the same issue, is there a fix for this?
Thanks in advance for hte help.
Version Information: