Hello, I have an application in blazor server which shows figures in colones, when I launch the app with Visual Studio, everything is displayed correctly:
However, when I publish it in the azure app service, something happens that is not shown as it should be:
To set the culture I use this code in the Program.cs :
CultureInfo culture = CultureInfo.CreateSpecificCulture("es-CR");
CultureInfo cultureUI= System.Globalization.CultureInfo.CreateSpecificCulture("es");
//culture.NumberFormat.NumberDecimalSeparator = ".";
//cultureUI.NumberFormat.NumberDecimalSeparator = ".";
System.Threading.Thread.CurrentThread.CurrentCulture = culture;
System.Threading.Thread.CurrentThread.CurrentUICulture = cultureUI;
//System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("es-ES");
//System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("es");
var builder = WebApplication.CreateBuilder(args);
var config = builder.Configuration;
const string urlconnectionString = "RestConnection";
const string storage = "Storage";
// Add services to the container.
builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor();
Is it some configuration that I must make in the azure app service or a programming error?
Well after a long search I realized that it was indeed a programming issue. You have to configure the culture in the Program.cs: