不支持文化1033(0x0409)

问题描述 投票:0回答:1

我正在使用dotnet 2.2映像在以下环境中运行我的服务应用程序:docker windows(Linux容器)

FROM mcr.microsoft.com/dotnet/core/sdk:2.2-alpine AS build-env

并且出现以下错误:

System.Globalization.CultureNotFoundException:不支持区域性。参数名称:文化| 1033(0x0409)是无效的区域性标识符。

我已经在docker文件中设置了以下内容。构建没有问题,但在运行应用程序时仍然显示错误

# Set the locale
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8 
.net docker .net-core alpine icu
1个回答
0
投票

这可行。

更新解决方案:我已经在teamcity上运行了相同的docker映像,基于linux的环境,根本不需要多余的行来定义代码页。

因此,此问题仅发生在Windows 10上运行的docker windows(Linux容器)上。

# Disable the invariant mode (set in base image)
RUN apk add --no-cache icu-libs

ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
    LC_ALL=en_US.UTF-8 \
    LANG=en_US.UTF-8
© www.soinside.com 2019 - 2024. All rights reserved.