SqlConnection.Open throws an InvalidOperationException
SqlConnection throw an Exceoption by calling open Method
When I add this configuration to the project.csproj,whether the value is true or false
<ItemGroup>
<RuntimeHostConfigurationOption Include="System.Globalization.Invariant" Value="true" />
</ItemGroup>
SqlConnection throws an Exceoption by calling open Method
var connection = new SqlConnection();
connection.ConnectionString = "SomeConnectionString ";
connection.Open();
InvalidOperationException: Internal connection fatal error.
System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, uint waitForMultipleObjectsTimeout, bool allowCreate, bool onlyOneCheckConnection, DbConnectionOptions userOptions, out DbConnectionInternal connection)
@tarekgh any advice here? cc @keeratsingh @AfsanehR @David-Engel
SQL team need to take a look to know why the connection is failed. the issue here is not clear to me why this is failed.
@wuxubiao By the initial looks of the issue it seems quite similar to an existing issue #29147.
As per the discussions it seems like SqlClient currently doesn't support running with the Globalization Invariant Mode. The workaround is to install the package icu-libs and set DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
If the issue still exists could you kindly share the following:
- Output of command dotnet --info.
- Repro with the csproj file that is being used. (includes the SqlClient version)
- Complete stack trace.
@karelz Should this issue be moved to https://github.com/dotnet/corefx and tracked there instead ?
Yes, either close it as dupe of existing CoreFX issue, or move it to CoreFX. Does it exist in CoreFX already?
#29147 already exists in CoreFX, however before I move/mark issue(#2072) as duplicate, I need more information form the user. I will proceed accordingly once I have the required information.
In such case it is up to you if you want to track it here and then dupe it/move it, or move it right away to clarify in CoreFX.
@wuxubiao By the initial looks of the issue it seems quite similar to an existing issue #29147. As per the discussions it seems like SqlClient currently doesn't support running with the
Globalization Invariant Mode. The workaround is to install the packageicu-libsand setDOTNET_SYSTEM_GLOBALIZATION_INVARIANT=falseIf the issue still exists could you kindly share the following:
- Output of command dotnet --info.
- Repro with the csproj file that is being used. (includes the SqlClient version)
- Complete stack trace.
install icu,it work
Duplicate of https://github.com/dotnet/corefx/issues/29147
@keeratsingh I updated your above message - this way GH recognizes it as duplicate - see https://github.com/dotnet/core/issues/2072#event-1990313873