DOTNET CORE "Couldn't find a valid ICU package installed on the system. Set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support."


Couldn't find a valid ICU package installed on the system. Set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support.

解决方案(官方)https://github.com/dotnet/core/blob/main/Documentation/build-and-install-rhel6-prerequisites.md

1. 最简单操作 添加一个环境变量

$ export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1

然后直接运行可执行文件

2. 面向开发人员的方式 在 runtimeconfig.json 配置文件中

加入

{
    "runtimeOptions": {
        "configProperties": {
            "System.Globalization.Invariant": true
        },
    }
}

3. 在项目的配置文件中 .csproj 文件中加入 msbuild 配置

  <PropertyGroup>
    <InvariantGlobalization>true</InvariantGlobalization>
  </PropertyGroup>


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM