You may encounter exception "System.NotSupportedException: Globalization Invariant Mode is not supported" in Microsoft.Data.SqlClient in Linux Alpine docker images. Exception details are as below.
fail: Poc.Common.Api.Middleware.GlobalExceptionHandlerMiddleware[0] Unexpected error occurred. System.NotSupportedException: Globalization Invariant Mode is not supported. at Microsoft.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry, SqlConnectionOverrides overrides) at Microsoft.Data.SqlClient.SqlConnection.Open(SqlConnectionOverrides overrides) at Microsoft.Data.SqlClient.SqlConnection.Open() at Poc.Domain.Core.Implementation.Sql.SqlCommanRunner.RunAsync(String command) in /build/src/Shared/Domain/Poc.Domain.Core/Implementation/Sql/SqlCommanRunner.cs:line 20
This exception occures due to Alpine images by defualt does not have globalization support. To eable globalization support for Alphine docker images and run .NET applications with SqlClient add the below to your base docker image.
No comments:
Post a Comment