-
Notifications
You must be signed in to change notification settings - Fork 286
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
Entity Framework Core 8: CultureNotFoundException #2237
Comments
The issue appears to be caused by an undocumented breaking change in .NET 8. The ASP.NET Core WebAPI now includes the true in the .csproj file which seams like a mistake. |
@patr543a if you believe there's an undocumented breaking change in .NET 8, can you please open an issue for that and reference it here? |
@patr543a - what version of Microsoft.Data.SqlClient are you using? #1917 made this a better error experience. Instead of getting the above exception, you should get: "Globalization Invariant Mode is not supported." SqlClient/src/Microsoft.Data.SqlClient/src/Resources/Strings.resx Lines 4671 to 4673 in e6109f8
|
In addition to having a better error message, there should be the possibility to make InvariantGlobalization work in new projects. The old behavior should be the default to avoid causing issues in existing projects, but for new projects, it represents a problem not being able to use invariant globalization. Especially in large projects with many developers, it is essential to have a default and not have to specify "InvariantCulture" or "StringComparison.Ordinal" in every method that requires it, because it's possible to make mistakes. |
Pretty sure i am using the newest since i am using .NET 8 |
It does work in new project and old projects it only breaks when code tries to use methods that it disables |
I have a solution with and API when i call the Get method on my BookingController it goes all the way through my method without issues but somewhere during the returning from the database the error occurs. I was unsure what to include and not to include so i have included a .zip file with all the projects that are used for the API, other files that wasn't strictly needed is not included if anything else is require i can give it as well so i hope this is enough.
TurboCart.zip
The resulting error in Swagger
EF Core version: 8.0.0
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET 8.0
Operating system: Windows 10
IDE: Visual Studio 2022 17.9 Preview 1.0
EDIT: As @roji said i have now made a new post on the documentation missing. Here
The text was updated successfully, but these errors were encountered: