-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Could not load type 'SqlGuidCaster' from assembly Microsoft.Data.SqlClient #33430
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
Comments
Not going to happen, as 5.2 is not LTS and .NET 8 is. You can just add an explicit reference. |
Then can the dotnet team work internally to backport the fix to a 5.1.6 release? This is a major and long-standing breaking issue for those trying to migrate their projects; it seems unreasonable to me to have us work around it on our end. |
We're actually going to revert to an older release for EF Core 9, since we can't take a dependency on a non-LTS version. So EF Core won't depend on anything above 5.1 until at least EF Core 10. |
Could I ask you to explain how to do that? Thanks! |
Add this to your .csproj file that reference the EF Core SQL Server provider:
|
https://learn.microsoft.com/en-us/nuget/concepts/dependency-resolution#direct-dependency-wins For doc reference |
Thank you for sharing this solution! I ran into the same issue and confirmed that adding the following to the .csproj file resolves it: |
Recently upgrade project from .net7 to .net8 and immediately ran into this old dotnet/SqlClient#1930
Seems that the root cause is any older version of Microsoft.Data.SqlClient (<5.2.0) than the newest release not playing well with reflection calls loading types/assemblies.
Could we get Microsoft.EntityFrameworkCore.SqlServer to update to use the new version?
The text was updated successfully, but these errors were encountered: