I have a SQL Server project in a solution. I've made some updates to the database directly in SQL Server Management Studio and I want to update the SQL Server project in Visual Studio to match the schema of the database. In Visual Studio when I select "Compare Schema" and choose the database as the source and the project directory as the target, and then click "Compare", the results of the compare are shown on screen, but then Visual Studio crashes immediately thereafter. I'm running Visual Studio 2015 Professional with Update 2 installed, and I have Microsoft SQL Server Data Tools 2015. The following details show up in the Event Viewer:
Application: devenv.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: Microsoft.VisualStudio.Composition.CompositionFailedException
at Microsoft.VisualStudio.Composition.ExportProvider.GetExports(Microsoft.VisualStudio.Composition.ImportDefinition)
at Microsoft.VisualStudio.Composition.ExportProvider.GetExports[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.String, Microsoft.VisualStudio.Composition.ImportCardinality)
at Microsoft.VisualStudio.Composition.ExportProvider.GetExport[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.String)
at Microsoft.VisualStudio.Composition.ExportProvider.GetExport[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.String)
at Microsoft.VisualStudio.Composition.ExportProvider.GetExport[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]()
at Microsoft.VisualStudio.Composition.ExportProvider.GetExportedValue[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]()
at Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetService[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]()
at Microsoft.VisualStudio.Data.Tools.Package.SchemaCompare.UI.ComparisonControl.SetSourceAndTargetScripts(System.String, System.String, System.Collections.Generic.IDictionary`2<System.Object,System.Object>, System.Collections.Generic.IDictionary`2<System.Object,System.Object>)
at Microsoft.VisualStudio.Data.Tools.Package.SchemaCompare.UI.ComparisonControl.ClearText()
at Microsoft.VisualStudio.Data.Tools.Package.SchemaCompare2.UI.SchemaCompareEditorControl.PopulateMainGrid(Boolean)
at Microsoft.VisualStudio.Data.Tools.Package.SchemaCompare2.UI.SchemaCompareEditorControl+<>c__DisplayClass44_0.<HandleModelCompareCompleted>b__0()
at Microsoft.VisualStudio.Shell.InvokableAction.InvokeMethod()
at Microsoft.VisualStudio.Shell.InvokableBase.Invoke() Exception Info: Microsoft.VisualStudio.Composition.CompositionFailedException
at Microsoft.VisualStudio.Shell.ThreadHelper.InvokeOnUIThread(Microsoft.VisualStudio.Shell.InvokableBase)
at Microsoft.VisualStudio.Shell.ThreadHelper.Invoke(System.Action)
at Microsoft.VisualStudio.Data.Tools.Package.SchemaCompare2.UI.SchemaCompareEditorControl.HandleModelCompareCompleted(System.Object, Microsoft.Data.Tools.Schema.Utilities.Sql.SchemaCompare.DataModel.OperationEventArgs)
at System.EventHandler`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Invoke(System.Object, System.__Canon)
at Microsoft.Data.Tools.Schema.Utilities.Sql.SchemaCompare.DataModel.SchemaCompareDataModel.RaiseEvent[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.EventHandler`1<System.__Canon>, System.__Canon)
at Microsoft.Data.Tools.Schema.Utilities.Sql.SchemaCompare.DataModel.SchemaCompareDataModel.Compare()
at Microsoft.Data.Tools.Schema.Utilities.Sql.SchemaCompare.DataModel.SchemaCompareDataModel.<CompareAsync>b__184_0()
at Microsoft.Data.Tools.Schema.Utilities.Sql.SchemaCompare.DataModel.SchemaCompareDataModel+<>c__DisplayClass204_0.<RunAsync>b__0(System.Object)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
Try to clear the Visual Studio
cache in:
C:\Users\[user]\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache
By removing everything in this directory, and restart the Visual Studio.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With