Hi,
We are getting an error when we try to deploy our Web Api product with .net 6 , on Linux Alpine.
The issue occurs when we deploy our product on Alpine Linux docker environment and starts our project . As we are running the Migration script[context.Database.Migrate()] in the startup.cs file.
At this time we are getting Exception.
System.Globalization.CultureNotFoundException: Only the invariant culture is supported in globalization-invariant mode. See https://aka.ms/GlobalizationInvariantMode for more information. (Parameter 'name')\nen-us is an invalid culture identifier.\n at System.Globalization.CultureInfo.GetCultureInfo(String name)\n at Microsoft.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry, SqlConnectionOverrides overrides)\n at Microsoft.Data.SqlClient.SqlConnection.Open(SqlConnectionOverrides overrides)\n at Microsoft.Data.SqlClient.SqlConnection.Open()\n at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerConnection.OpenDbConnection(Boolean errorsExpected)\n at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternal(Boolean errorsExpected)\n at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(Boolean errorsExpected)\n
We have gone through several technical vlogs and found that others are also facing the same error in similar environment.'
Findings:
Note - In my project, we are using Invariant culture only.
Please provide some help on this..
Is this a known bug in .Net release i.e will .Net6 project won't work with alpine image and MSSQL?
OR, any other way to resolve this issue.
Thanks
Mohit
We are getting an error when we try to deploy our Web Api product with .net 6 , on Linux Alpine.
The issue occurs when we deploy our product on Alpine Linux docker environment and starts our project . As we are running the Migration script[context.Database.Migrate()] in the startup.cs file.
At this time we are getting Exception.
System.Globalization.CultureNotFoundException: Only the invariant culture is supported in globalization-invariant mode. See https://aka.ms/GlobalizationInvariantMode for more information. (Parameter 'name')\nen-us is an invalid culture identifier.\n at System.Globalization.CultureInfo.GetCultureInfo(String name)\n at Microsoft.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry, SqlConnectionOverrides overrides)\n at Microsoft.Data.SqlClient.SqlConnection.Open(SqlConnectionOverrides overrides)\n at Microsoft.Data.SqlClient.SqlConnection.Open()\n at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerConnection.OpenDbConnection(Boolean errorsExpected)\n at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternal(Boolean errorsExpected)\n at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(Boolean errorsExpected)\n
We have gone through several technical vlogs and found that others are also facing the same error in similar environment.'
Findings:
- When we try to run our webapi project with (Debian +.net6+ MSSQL), it works fine.
- When we try to run our webapi project with (Alpine+.net6+ Mysql/Oracle/Postgre), it works fine.
Note - In my project, we are using Invariant culture only.
Please provide some help on this..
Is this a known bug in .Net release i.e will .Net6 project won't work with alpine image and MSSQL?
OR, any other way to resolve this issue.
Thanks
Mohit