-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Couldn't use Microsoft.EntityFrameworkCore.SqlServer > 6.0.14 #1944
Comments
@sake402 You connection string looks odd, do you really mean "user instance=true" and if so, I think you are missing:
https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/sql/sql-server-express-user-instances |
Hi @sake402, usually an exception from SNI Native with a memory access violation could potential mean there's a mismatch between a compatible version of Microsoft.Data.SqlClient.SNI and Microsoft.Data.SqlClient specifically for Windows. From what I can tell so far, between EF Core 6 and EF Core 7 is that EF Core 6 uses Microsoft.Data.SqlClient version 2.1.4 and EF Core 7 uses Microsoft.Data.SqlClient version 5.0.1 and when upgrading between those version, in the documentation, it also mentions breaking changes as well. Also, as @ErikEJ mentioned, there's potentially a missing property in the connection string. Is there a sample repro project that you can provide? or are you able to try it with the missing property |
@ErikEJ Thanks for your response. I was trying a number of combination as it confuses me the source of the error. So I happen to have left that fragment there. At your words, I however tested again with
and also
Same result. The only that works is if I downgrade to EF6. |
@lcheunglci Thank for your response. |
@sake402 can you confirm that SNI version is accurate? We are looking for Microsoft.Data.SqlClient.SNI package. Each version of M.D.SqlClient has a dependency to a specific version of SNI. You can clean your project and build it again with dependency to M.D.SqlClient v5.1.0. Make sure that you have M.D.SqlClient.SNI or M.D.SqlClient.SNI.runtime with version of 5.1.0 as well. |
Please provide a repro project. |
I have the same issue. "Repro": .csproj:
Program.cs:
Note that it doesn't actually matter if the database server at .\SQLEXPRESS actually exists, it doesn't even matter if the mdf file exists, simply any attempt at connecting to any server with "User Instance=true" results in access violation every single time SqlClient is 5.1.1 and SNI runtime 5.1.0. Platform is x64 windows I don't really care about this SQL Server feature, it's just that access violation exceptions are super nasty since they are not recoverable. The issue started for us when we upgraded from 4.1.0 to 5.1.1 I ran a bisect on this with my repro and it broke at commit 778f86e aka #1608 |
I found the issue and will send a one-liner pull request shortly... |
I'm experiencing the same after upgrading Microsoft.Data.SqlClient to 5.1.1. But only see it when running with Azure Function. If I use the class library from an Asp.net application |
Given the connection string in appsettings.json
and then
It works with version 6.0.14, however because we need TPC mapping we need to use higher version, but with version 7.0.0 - 7.0.3 there is an error
Running the application results in the same exception.
The text was updated successfully, but these errors were encountered: