2

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'.

Currently have the following packages installed

    <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" />
Dr Schizo
  • 4,045
  • 7
  • 38
  • 77
  • see my answer here: https://stackoverflow.com/questions/41027953/sql-server-always-encrypted-with-net-core-not-compatible – Tim Bijnens Mar 03 '20 at 11:24
  • Does this answer your question? [SQL Server Always Encrypted with .NET Core not compatible](https://stackoverflow.com/questions/41027953/sql-server-always-encrypted-with-net-core-not-compatible) – Tim Bijnens Mar 03 '20 at 11:24

1 Answers1

7

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();
    }
Dr Schizo
  • 4,045
  • 7
  • 38
  • 77