ErikEJ / EntityFramework6PowerTools

This is the codebase for Entity Framework 6 Power Tools Community Edition, and modern EF 6 providers for SQL Server and SQL Server Compact
Other
183 stars 27 forks source link

Not working for upgrade to .net 6 #101

Closed malixg closed 2 years ago

malixg commented 2 years ago

I have an application that uses EF with SQLEXPRESS2019 and always encrypt. I'm trying to migrate from .net framework 4.8 to .net 6. I'm well into the process and getting stuck at the error "Keyword not supported: 'column encryption setting'". My searches brought me here. I've installed the nuget package. I've added the DbConfigurationTypeAttribute(typeof(MicrosoftSqlDbConnection) as well as calling DbConfiguration.SetConfiguration(new MicrosoftSqlDbConnection()); I've replaced all the using with the Microsoft.* versions. I am still getting the same error about the column encryption. When I inspect the created dbContext.Database, it is still using the System.Data.SqlClient. Any advice? Thanks

ErikEJ commented 2 years ago

@malixg You are doing something wrong. But I cannot tell what without a repro project.

ErikEJ commented 2 years ago

It should be:

[DbConfigurationType(typeof(MicrosoftSqlDbConfiguration))] 
MikeFarrington commented 2 years ago

I too am having issues getting this to work. I've stripped my solution down to next to nothing to rule out as much as possible. It's a .NET 6 WPF app, without an app.xaml, and neither the DbConfigurationType attribute nor DbConfiguration.SetConfiguration method is working. Though, I am not seeing System.Data.SqlClient like @malixg is seeing.

I'll try to strip down the project as much as possible in the next day or two and try to get it to you for debugging. Thanks for everything.

ErikEJ commented 2 years ago

@MikeFarrington looking forward to your repro

ErikEJ commented 2 years ago

@MikeFarrington And please create a new issue with your repro

MikeFarrington commented 2 years ago

Well, don't I feel dumb...

After many hours struggling with everything, it wasn't until looking at the available properties in SqlConnectionStringBuilder and seeing ColumnEncryptionSetting did I realize that I now need to add "Column Encryption Setting=true" to my connection string, whereas it was all very transparent and automatic previously.

Welp, there's a weekend I won't get back. Once again though, thank you for all of your efforts.