0

I have a database with always encrypted in SQL Server Express.

I migrated my SQL Server version from 2017 (v14) to 2019 (v15), in this new version there is a secure enclave option available for always encrypted that I'm not using.

When I connect from SQL Server Management Studio, everything is fine, I can see the encrypted information as always, but when I try to use it on my application with Entity Framework, I get this error:

System.Data.SqlClient.SqlException: Operation supported by enclaves invoked on data encrypted with randomized encryption where the keys are not enclave-enabled. Please clear the proc cache

My connection string is:

Data Source=localhost\SQLEXPRESS;Initial Catalog=Derma2Go_test;Integrated Security=True;MultipleActiveResultSets=True;Column Encryption Setting=enabled

I get error #33580 in SQL Server.

I am using Entity Framework 6.0.0.0

I don't want to use the secure enclaves in my database, how can I resolve this issue?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • The error doesn't come from Entity Framework. It comes from ADO.NET. You'd have a similar problem if you tried to execute a SQL query with SqlCommand. – Panagiotis Kanavos Sep 14 '22 at 13:11
  • You should probably migrate to .NET Core and EF Core 6. First, the latest is EF 6.4.4. Second, EF itself is no longer actively developed. Development has shifted to .NET Core, EF Core and a completely new SQL Server client, Microsoft.Data.SqlClient which contains support and fixes for Always Encrypted problems. There's [a possibly relevant Github issue for EF 6](https://github.com/dotnet/ef6/issues/389) that was closed on April 2022 with the comment `This issue has been closed because EF6 is no longer being actively developed.` – Panagiotis Kanavos Sep 14 '22 at 13:19

0 Answers0