Visual Studio 2015 Update 2 Professional Crashes on Schema Compare
Asked Answered
C

1

5

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() 
Coronograph answered 21/6, 2016 at 19:25 Comment(4)
Did you ran VS as administrator?Rosenbaum
Yes I'm running VS as administrator. Thanks for your reply.Coronograph
You're welcome, do you have the services for the SQL Server running?Rosenbaum
Yes, the services are running - I can query the database I'm connecting to.Coronograph
R
15

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.

Rosenbaum answered 23/6, 2016 at 17:19 Comment(4)
This worked for me too! I had to re-install the Data Tools and this broke VS, but this restored the functionality - thank you.Spirketing
This seems to have worked for me as well - been digging around for a solution to this for a while - thanks! Any information on why this often is the solution?Incurvate
You're very welcome to all of you :) @TylerNielsen I have no clue what is the specific reason, sorry bro. If I know why, I am going to let you know for sure :DRosenbaum
Seriously man, once I clear it, immediately I am able to expand the setting for schema compare. Thanks!Platyhelminth

© 2022 - 2024 — McMap. All rights reserved.