本文介绍了.NET Core 3.1 始终加密的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在使用 .NET Core 3.1 和 SQL Always Encrypted 时收到以下错误.这在 3.1 中支持吗?也许我在这里遗漏了一些东西..
I am getting the following error when using .NET Core 3.1 and SQL Always Encrypted. Is this supported in 3.1? Perhaps I am missing something here..
Keyword not supported: 'column encryption setting'.
目前安装了以下软件包
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.12.0" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
<PackageReference Include="Dapper" Version="2.0.30" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider" Version="1.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.AzureKeyVault" Version="3.1.1" />
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
<PackageReference Include="Serilog.Extensions.Logging" Version="3.0.1" />
<PackageReference Include="Serilog.Settings.Configuration" Version="3.1.0" />
<PackageReference Include="Serilog.Sinks.ApplicationInsights" Version="3.0.4" />
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
推荐答案
需要将以下包引用添加到 Microsoft.Data.SqlClient
(请参阅 nuget) 并使用此 Microsoft.Data.SqlClient
而不是System.Data.SqlClient
.
Needed to add the following package reference to Microsoft.Data.SqlClient
(see nuget) and use this Microsoft.Data.SqlClient
and NOT System.Data.SqlClient
.
using (var conn = new Microsoft.Data.SqlClient.SqlConnection(connectionString))
{
await conn.OpenAsync();
}
这篇关于.NET Core 3.1 始终加密的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!