我在解決方案中有一個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()
你以管理員身份運行VS嗎? – fredyfx
是的,我以管理員身份運行VS。感謝您的回覆。 – Andy
不客氣,你有SQL Server運行服務嗎? – fredyfx