2016-06-21 65 views
3

我在解決方案中有一個SQL Server項目。我直接在SQL Server Management Studio中對數據庫進行了一些更新,我想在Visual Studio中更新SQL Server項目以匹配數據庫的模式。在Visual Studio中,當我選擇「Compare Schema」並選擇數據庫作爲源和項目目錄作爲目標,然後單擊「比較」時,比較結果顯示在屏幕上,但隨後Visual Studio立即崩潰。我在運行Visual Studio 2015年專業與更新2安裝,和我有Microsoft SQL Server數據工具2015以下詳細信息在事件查看器中顯示:Visual Studio 2015更新2在架構上的專業崩潰比較

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() 
+0

你以管理員身份運行VS嗎? – fredyfx

+0

是的,我以管理員身份運行VS。感謝您的回覆。 – Andy

+0

不客氣,你有SQL Server運行服務嗎? – fredyfx

回答

11

嘗試清除Visual Studio緩存:

C:\Users\[user]\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache 

通過刪除此目錄中的所有內容,然後重新啓動Visual Studio。

+1

這不知何故神奇總是似乎做的伎倆。 – drleifz

+1

這也適用於我!我不得不重新安裝數據工具,這打破了VS,但這恢復了功能 - 謝謝。 – Neilski

+1

對我有效,謝謝:) –

相關問題