Column encryption in ASP MVC app with SQL Server 2016 using .net Core / EF Core

别来无恙 提交于 2020-01-12 03:31:06

问题


I am trying to use the "Always Encrypted" feature in SQL Server 2016 to encrypt some columns. I used this post as a guide to set the columns as encrypted in SSDT.

That part goes fine, it's when I attempt to query the data from the application that I get an error. According to the docs I need to add this:

column encryption setting=enabled

to my connection string. This does not appear to be supported in Entity Framework Core. I get this error:

column encryption setting=enabled is not supported

I tried using the SqlConnectionStringBuilder to build the string as well and the ability to add that setting is not there. It does appear to be there in .NET 4.6.

So, is anyone aware of a way to connect to an SQL server instance from a .NET Core application using Always Encrypted?


回答1:


Always Encrypted is currently not supported on .Net Core

You can find the list of supported frameworks here

Adding Support for .NET core is on our roadmap, we do not have timeline for it yet

Please follow this github issue for updates




回答2:


As mentioned by MS folks - Always Encrypted is currently not supported on .Net Core.

  • We had the same situation, finally we had to make the Core WebApp to target .NET Full Framework, there is no other option.

  • i.e., Currently not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1) Compatible with net452 (.NETFramework,Version=v4.5.2)

  • From forums - "Eventhough EF Core could work for AE feature, but still the underlying .NET Core SQL Client currently does not support for AE, and it will be in their (MS + Opensource ontributors) future mile stone to support it"

Please refer this GitHub page for any recent updates on this issue:




回答3:


Always Encrypted is now supported in the .NET Core 3.0 Preview 5 through the new Microsoft.Data.SqlClient data provider for Microsoft SQL Server.




回答4:


It just mention here

Microsoft.data.sqlclient



来源:https://stackoverflow.com/questions/41175489/column-encryption-in-asp-mvc-app-with-sql-server-2016-using-net-core-ef-core

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!