-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
The name passed to DbProviderFactories.GetFactory
is case sensitive but the error message indicates the name is "invariant" which isn't correct
#110236
Comments
Tagging subscribers to this area: @roji, @ajcvickers |
Makes sense, looks like the error message needs to be fixed. |
I'd think "invariant" there just means the name does not depend on language settings, and that "invariant" does not imply that the name is case-insensitive. |
@KalleOlaviNiemitalo agreed about invariant, but the exception message seems to show a lower-case version of the invariant name |
@roji, the "Reproduction Steps" in the issue description have the lower-case name in |
@KalleOlaviNiemitalo oh I see - I read the original issue a bit too quickly, thanks for correcting me on that. @icnocop if your suggestion/request is indeed to update the exception message to remove the word "invariant" there, then as @KalleOlaviNiemitalo wrote above, invariant does not mean "case-insensitive", and it makes for it to stay there. I'll go ahead and close this issue with that assumption, but feel free to post back here if I've misunderstood or you have further comments. |
Description
In .NET Framework the data provider factory name is case insensitive, but in .NET 8 at least, the name is now case sensitive, but the error message hasn't been updated to reflect the breaking change.
Reproduction Steps
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.2" />
Expected behavior
I expected the provider name to not be case sensitive, or the error message to be updated.
Actual behavior
Regression?
Yes, it worked in .NET Framework 4.7.2.
Known Workarounds
As a work-around, register providers using all lower-case characters, and then call
DbProviderFactory factory = DbProviderFactories.GetFactory(providerName.ToLower());
for example.Configuration
.NET 8
Windows 10 64-bit
Other information
runtime/src/libraries/System.Data.Common/src/System/Data/Common/DbProviderFactories.cs
Line 154 in af3393d
https://github.com/dotnet/dotnet/blob/83244d9bd58049da40ce5a822579735dc8ba1f4d/src/runtime/src/libraries/System.Data.Common/src/System/Data/Common/DbProviderFactories.cs#L154
The text was updated successfully, but these errors were encountered: