gpt4 book ai didi

c# - Microsoft SqlServer 管理 : method not found creating a ServerConnection

转载 作者:行者123 更新时间:2023-12-05 03:19:26 27 4
gpt4 key购买 nike

Microsoft.SqlServer.SqlManagementObjects 161.47027.0

微软.数据.SqlClient 5.0.0

将 Microsoft.Data.SqlClient 从 4.1.0 升级到 5.0.0 后我在创建 ServerConnection 对象时遇到此错误:

using Microsoft.SqlServer.Management.Common;

var serverConnection = new ServerConnection("localhost", "sa", "mypwd");

System.MissingMethodException: 'Method not found: 'VoidMicrosoft.Data.SqlClient.SqlConnectionStringBuilder.set_Encrypt(Boolean)

它在 Microsoft.Data.SqlClient.SqlConnectionStringBuilder 中寻找未实现的 set_Encrypt 方法

这是否意味着 Microsoft.SqlServer.SqlManagementObjects 尚未更新以支持 Microsoft.Data.SqlClient 5.0.0?

如果是这样,我是否需要等待此更新才能将 Microsoft.Data.SqlClient 5.0.0 升级到我的项目中?

最佳答案

也可以将ServerManagementObjects引用升级到170.7.0-preview来解决。显然问题出在 smo 库而不是 sqlclient 库。 https://github.com/dotnet/SqlClient/issues/1702

Their code should be backwards compatible, but they need to be recompiled against MDS 5.0

关于c# - Microsoft SqlServer 管理 : method not found creating a ServerConnection,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73457750/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com