使用CentOS UserLand在Raspberry Pi3上运行dotnet核心应用程序

我正在尝试在运行CentOS arm版本(CentOS-Userland-7-armv7hl-Minimal-1708-RaspberryPi3)的Raspberry Pi3 Model B上运行我的AspNetCore 2应用程序.我用yum install安装了libunwind和libicu-devel,但是在尝试运行我的应用程序时,我总是收到以下错误:

[root@centos-rpi3 ~]# /opt/dotnet/dotnet my.dll

FailFast: 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.

   at System.Environment.FailFast(System.String)
   at System.Globalization.GlobalizationMode.GetGlobalizationInvariantMode()
   at System.Globalization.GlobalizationMode..cctor()
   at System.Globalization.CultureData.CreateCultureWithInvariantData()
   at System.Globalization.CultureData.get_Invariant()
   at System.Globalization.CultureData.GetCultureData(System.String, Boolean)
   at System.Globalization.CultureInfo.InitializeFromName(System.String, Boolean)
   at System.Globalization.CultureInfo.Init()
   at System.Globalization.CultureInfo..cctor()
   at System.Globalization.CultureInfo.get_InvariantCulture()
   at System.StringComparer..cctor()
   at System.AppDomainSetup.SetCompatibilitySwitches(System.Collections.Generic.IEnumerable`1<System.String>)
   at System.AppDomain.PrepareDataForSetup(System.String, System.AppDomainSetup, System.Security.Policy.Evidence, System.Security.Policy.Evidence, IntPtr, System.String, System.String[], System.String[])
Aborted

对于dotnet核心安装,我按照此处描述的指南(任务:在Raspberry Pi上安装.NET Core Runtime):https://blogs.msdn.microsoft.com/david/2017/07/20/setting_up_raspian_and_dotnet_core_2_0_on_a_raspberry_pi/

任何想法为什么dotnet核心会抛出这个错误?

最佳答案
我有同样的问题.我试图在Ubuntu核心上运行一个自包含的dotnet核心2.0应用程序.当我设置“System.Globalization.Invariant”时,我得到了它的工作:true.

有一个名为.runtimeconfig.json的文件

在此文件中,您需要将以下内容放入:

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

然后它应该工作.

转载注明原文:使用CentOS UserLand在Raspberry Pi3上运行dotnet核心应用程序 - 代码日志