Unable to up the server .Net6 with Alpine linux environment with MSSQL

Mohit kohli 0 Reputation points
2023-04-27T05:43:59.24+00:00

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:

  1. When we try to run our webapi project with (Debian +.net6+ MSSQL), it works fine.
  2. When we try to run our webapi project with (Alpine+.net6+ Mysql/Oracle/Postgre), it works fine.

The only issue seems to be with MSSQL database.

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

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
3,789 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
11,640 questions
0 comments No comments
{count} votes