We have a .Net core Web API application
we have created the server image (Alpine) and trying to host it in docker environment where MSSQL is already installed and configured.
when we try to up the container,
we get this error =>
,"Context":"", "Details":"","Message":"Server initialized with errors. Failed to update server public url and tls certificate thumbprint.System.Globalization.CultureNotFoundException: Only the invariant culture is supported in globalization-invariant mode. See [https://aka.ms/GlobalizationInvariantMode](https://aka.ms/GlobalizationInvariantMode"Follow link") 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.'
below are my findings :-
- Other persons are also facing this error in .Net with Alpine linux environment.
- I didn't found any explanation on internet why it's occurs for MSSQL database only.
- There are multiple articles like this which is suggesting to set InvariantGlobalization property to false in docker file., but according to our project needs we can't do this bcz we use Invariantculture only. link - https://stackoverflow.com/questions/71045784/running-net-6-project-in-docker-throws-globalization-culturenotfoundexception
- According to this article - https://github.com/elastic/apm-agent-dotnet/issues/1985 => this is known bug in .Net 6 that will get fix in later versions. but i'm not sure about this.
Note - In my project, we are not using any culture i.e we're using Invariant culture.
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.