SQL Prompt 10.5.x not loading in Visual Studio 2017/2019
TheoL
Posts: 17 Bronze 1
in SQL Prompt
I mostly use SQL Prompt in SSMS 18.x - and it's working fine there.
However, when trying to use in Visual Studio 2017 (or 2019) to format SQL code, the moment I enter the "Format SQL", I get an error message indicating SQL Prompt could not load.
When looking at the ActivityLog.xml I have:
This is located after the entry
Certainly SQL Prompt in SSMS is working, as well as other tools from SQL Toolbelt, so this might not be related.
Uninstalling / re-installing SQL Prompt 10.5.3 made no difference.
As it stands, for me SQL Prompt is completely non-functional in Visual Studio 2017/2019.
Anyone else having these sorts of issues?
However, when trying to use in Visual Studio 2017 (or 2019) to format SQL code, the moment I enter the "Format SQL", I get an error message indicating SQL Prompt could not load.
When looking at the ActivityLog.xml I have:
SetSite failed for package [SQLPromptPackage]Source: 'RedGate.SQLPrompt.UsageReporting' Description: The type initializer for 'Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration' threw an exception.
(followed by many more line of error message)This is located after the entry
Begin package load [SQLPromptPackage]
Further, in the SQL Prompt log, the following content shows:2021-01-06 18:06:29.147 +00:00|Error||| Failed to initialize the licensing client
2021-01-06 18:06:29.148 +00:00|Error||| Report error dialog UI shown
2021-01-06 18:06:29.148 +00:00|Error||| Report error dialog UI shown
Certainly SQL Prompt in SSMS is working, as well as other tools from SQL Toolbelt, so this might not be related.
Uninstalling / re-installing SQL Prompt 10.5.3 made no difference.
As it stands, for me SQL Prompt is completely non-functional in Visual Studio 2017/2019.
Anyone else having these sorts of issues?
Tagged:
Answers
The issue could be due to a different version of a dll being needed by Visual Studio and the latest SQL Prompt version.
Could you try the following steps:
1. Upgrade from 10.4.7 to SQL Prompt 10.5.3
2. In Visual Studio select the option to "Disable local Application Insights for Asp .Net Core web projects"
This can be done from :
“TOOLS –> Options –> Projects and Solutions –> Web Projects” and check “Disable local Application Insights for Asp.Net Core web projects.”
3. Try the Format SQL
Please do let us know if this does work for you.
Regards,
Sujay
The full error message from ActivityLog.xml:
SetSite failed for package [SQLPromptPackage]Source: 'RedGate.SQLPrompt.UsageReporting' Description: The type initializer for 'Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration' threw an exception. System.TypeInitializationException: The type initializer for 'Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration' threw an exception. ---> System.TypeLoadException: Could not load type 'System.Diagnostics.Activity' from assembly 'System.Diagnostics.DiagnosticSource, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. at Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration.<>c.<.cctor>b__13_0() at Microsoft.ApplicationInsights.ActivityExtensions.TryRun(Action action) at Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration..cctor() --- End of inner exception stack trace --- at RedGate.SQLPrompt.UsageReporting.AppInsightsClient.GetClient() at RedGate.SQLPrompt.UsageReporting.AppInsightsClient.get_Client() at RedGate.SQLPrompt.UsageReporting.ErrorReporting.ErrorReporter.CreateExceptionReporterController(Exception e, Boolean doRateLimit, Boolean shownToUser, Boolean includeUsersEmailAddress) at RedGate.SQLPrompt.UsageReporting.ErrorReporting.ErrorReporter.ShowError(Exception exception) at RedGate.SQLPrompt.VsPackage.SQLPromptPackage.<InitializeAsync>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Shell.AsyncPackage.<>c__DisplayClass16_0.<<Microsoft-VisualStudio-Shell-Interop-IAsyncLoadablePackageInitialize-Initialize>b__1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Threading.JoinableTask.<JoinAsync>d__78.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.VisualStudio.Services.VsTask.RethrowException(AggregateException e) at Microsoft.VisualStudio.Services.VsTask.InternalGetResult(Boolean ignoreUIThreadCheck) at Microsoft.VisualStudio.Services.VsTask.GetResult()System.TypeLoadException: Could not load type 'System.Diagnostics.Activity' from assembly 'System.Diagnostics.DiagnosticSource, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. at Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration.<>c.<.cctor>b__13_0() at Microsoft.ApplicationInsights.ActivityExtensions.TryRun(Action action) at Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration..cctor()
End package load [SQLPromptPackage]
I have "Application Insights Tools for Visual Studio Package - 8.14.20131.1" extension installed - part of the "Developer Analytics Tools" extension from Microsoft.
I tested both disabling and uninstalling the "Developer Analytics Tools" (and restarting), but neither of these changed the outcome.
Thank you for the update. I have escalated the issue to the development team along with the latest logs and that disabling the Local Application Insights did not solve the problme. I will let you know as soon as I get an update from the development team.
Regards,
Sujay
The issue is not yet fixed in 10.5.6.17542. I have once again escalated this to the development team and will let you know once there is an update
Regards,
Sujay
Any update on this - the error still remains...
Thanks!
The issue is still being looked into by the development team. We will post here as soon as there is any update available.
We appreciate your patience while we look into this.
Regards,
Sujay
Result:
Visual Studio 2017: Error still present
Visual Studio 2019: Appears to load OK - at least enough to appear in the menu. Did not test further before reverting back to version 10.4.7
These tests are done on the same computer.
Edit: More details:
SQL Prompt 10.6.2.18034
Visual Studio 2019, 16.8.5
It would be great if you can fix this - thanks!
Therefore I am back to the former version by updating and reinstalling ...
It would be very helpful to ensure that the latest release is immediatly pushed to the SQL Toolbelt download- many thanks!
The SQL Toolbelt at https://download.red-gate.com/installers/SQLToolbelt/2021-02-23/SQLToolbelt.exe has the updated version of SQL Prompt.
Regards,
Sujay
That is a good suggestion. The 10.4.7 build is available at https://download.red-gate.com/checkforupdates/SQLPrompt/SQLPrompt_10.4.7.16599.exe
Regards,
Sujay
For Visual Studio 2017, the development team has reviewed the issue.
Unfortunately, on this occasion, they are unable to work on a fix for this bug.
However, they have advised that a workaround can be used to overcome the issue.
In Visual Studio 2017, there is a conflict with Xamarian tools, and uninstalling these helps to stop the error.
Regards,
Sujay