由于异常,无法在 Visual Studio 2022 中比较数据库架构

问题描述 投票:0回答:2

我最近买了一台新笔记本电脑并在上面安装了 Visual Studio 2022。我正在尝试比较解决方案中 SQL Server 数据库项目的架构,但每次我尝试选择源或目标时,连接窗口都不会出现。相反,我看到了一个异常窗口。 在我的一生中,我一直无法解决这个问题。我在任何版本的 Visual Studio 中都从未遇到过这个问题。我尝试修复并重新安装 Visual Studio 2022,但无济于事。我在网上找不到这个问题的具体解决方案。 有人可以引导我走向正确的方向吗?

例外情况如下:

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Runtime.InteropServices.COMException (0x80004005): Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at Microsoft.VisualStudio.Data.Tools.Package.SharedUtilities.ProjectUtilities.GetGuidOfProject(IVsHierarchy projectNode)
   at Microsoft.VisualStudio.Data.Tools.Package.SchemaCompare2.UI.SchemaCompareConnectionDialog.PopulateProjectCombos()
   at Microsoft.VisualStudio.Data.Tools.Package.SchemaCompare2.UI.SchemaCompareConnectionDialog..ctor(Boolean isSource, ISchemaCompareParticipant participant)
   at Microsoft.VisualStudio.Data.Tools.Package.SchemaCompare2.UI.SchemaCompareSourceTargetControl.CollectFromConnectionDialog(Boolean isSource)
   at Microsoft.VisualStudio.Data.Tools.Package.SchemaCompare2.UI.SchemaCompareSourceTargetControl.OnSelectionChangeCommitted(Object sender, EventArgs e)
   at System.Windows.Forms.ComboBox.OnSelectionChangeCommitted(EventArgs e)
   at System.Windows.Forms.ComboBox.OnSelectionChangeCommittedInternal(EventArgs e)
   at System.Windows.Forms.ComboBox.WmReflectCommand(Message& m)
   at System.Windows.Forms.ComboBox.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

visual-studio exception compare schema
2个回答
3
投票

对我来说,这似乎是 VS 或 SSDT 中的一个错误。此处记录的问题:https://developercommunity.visualstudio.com/t/SQL-Schema-Comparison-Crash/10349368

与此同时,当 Microsoft 正在致力于修复时,您可以检查 SQL 数据库项目是否针对最新的 .NET Framework (4.8),并确保 .NET Framework SDK 和工具已作为您的应用程序的一部分进行安装。 VS 工作负载...

在文本编辑器中打开项目文件,并将

TargetFrameworkVersion
属性的值更改为
v4.8
。保存并重新加载项目/解决方案(可能需要重新启动 VS)。


0
投票

非常感谢您对 .NET Framework 4.8 功能的支持。

© www.soinside.com 2019 - 2024. All rights reserved.