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