当我在生产服务器上发布并运行我的应用程序时,小数分隔符(用于十进制类型数字)正在消失(用于背景计算和显示)。例如:26,1205 -> 261205
它仅发生在远程 Windows Server 2019 Standard 上。这就是我所做的,但它仍然没有帮助:
我在方法中设置CultureInfo
了应用程序:Startup.cs
Configure
var defaultDateCulture = "ru-RU"; //no matter what culture is set here (en, ru, etc), it applied locally but not on production
var ci = new CultureInfo(defaultDateCulture);
app.UseRequestLocalization(new RequestLocalizationOptions
{
DefaultRequestCulture = new RequestCulture(ci),
SupportedCultures = new List<CultureInfo> { ci },
SupportedUICultures = new List<CultureInfo> { ci }
});