If you are getting this error message when opening a solution in VS:
The ''SQLChangeAutomationVSPackage' package did not load correctly.
You can get more information about what's causing this by examining the file:
'C:\Users\Username\AppData\Roaming\Microsoft\VisualStudio\15.0\ActivityLog.xml'.
In some cases, you may be able to workaround this error by opening SQL Change Automation before opening your solution.
If the issue is not clear from the file, please log a ticket and include your ActivityLog.xml file as well as a screenshot of the error.
If you do not use SQL Change Automation and installed it by mistake, however, you can simply uninstall it. You can do this from Tools>Extensions and Updates, or if you had installed the free SQL Change Automation Core as part of Visual Studio, you can uninstall by modifying the Visual Studio install in Control Panel and removing the SQL Change Automation Core (or ReadyRoll Core) component.
Known causes
Incompatibility between the Serilog library used by SQL Change Automation for Visual and Github for Visual Studio
Github for Visual Studio uses an older version of the Serilog library
This will usually result in an error message inside the Activitylog.xml like this:
<type>Error</type><source>VisualStudio</source>
<description>SetSite failed for package [SqlChangeAutomationVsPackage]Source: 'RedGate.Versioning.Engine.Shared.Logging.Serilog' Description: Method not found: 'Serilog.LoggerConfiguration Serilog.FileLoggerConfigurationExtensions.File(Serilog.Configuration.LoggerSinkConfiguration, System.String, Serilog.Events.LogEventLevel, System.String, System.IFormatProvider, System.Nullable`1<Int64>, Serilog.Core.LoggingLevelSwitch, Boolean, Boolean, System.Nullable`1<System.TimeSpan>, Serilog.RollingInterval, Boolean, System.Nullable`1<Int32>, System.Text.Encoding)'.
System.MissingMethodException: Method not found: 'Serilog.LoggerConfiguration Serilog.FileLoggerConfigurationExtensions.File(Serilog.Configuration.LoggerSinkConfiguration, System.String, Serilog.Events.LogEventLevel, System.String, System.IFormatProvider, System.Nullable`1<Int64>, Serilog.Core.LoggingLevelSwitch, Boolean, Boolean, System.Nullable`1<System.TimeSpan>, Serilog.RollingInterval, Boolean, System.Nullable`1<Int32>, System.Text.Encoding)'.
 at RedGate.Versioning.Engine.Shared.Logging.Serilog.SerilogLoggerConfiguration.Logger[T]()
 at RedGate.Versioning.Client.VsShell.VisualStudio.Container.VsContainer.Prepare(VsServicesCache cache, JoinableTaskFactory joinableTaskFactory, ILoggerConfiguration loggerConfiguration)
 at RedGate.Versioning.Client.VsShell.VisualStudio.VsPackage.EntryPoints.SqlChangeAutomationVsPackage.<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__68.MoveNext()</description>
You can check if you have this extension by looking in Extensions -> Manage Extensions
f you have this extension please try the following workaround:
1- Close Visual Studio
2 - Back up the following files in C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\Extensions\Github\Github\
Serilog.dll
Serilog.Enrichers.Thread.dll
Serilog.Extensions.Logging.dll
Serilog.Sinks.Console.dll
Serilog.Sinks.File.dll
3 - Replace the file you've backed up in step 1 with the same name files from C:\ProgramData\Downloaded Installations\5E80012B9BFCA6976DE9380DB234AB38\MSBuild\SqlChangeAutomation\
4 - Restart Visual Studio
Was this article helpful?
Articles in this section
- Method not found: 'System.Security.CodeAccessPermission'
- Couldn't connect to the database specified by the Target parameter: A connection was successfully established with the server, but then an error occurred during the login process
- Could not install SqlChangeAutomation from any registered PSRepository
- System.Exception: No match was found for the specified search criteria and module name 'SQLChangeAutomation'. Try Get-PSRepository to see all available registered module repositories
- No match was found for the specified search criteria and module name 'SqlChangeAutomation'.
- Online index operations can only be performed in Enterprise edition of SQL Server
- Unable to resolve package source
- error 5(Access is denied.) while attempting to open or create the physical file
- SQL Change Automation Installation freezes at 99%
- SQL Change Automation Powershell permissions