8

I am trying to run my AspNetCore 2 application on a Raspberry Pi3 Model B that runs CentOS arm edition (CentOS-Userland-7-armv7hl-Minimal-1708-RaspberryPi3). I installed both libunwind and libicu-devel with yum install, but when trying to run my application, I always get the following error:

[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

For dotnet core installation I followed the guide described here (Task: Install the .NET Core Runtime on the Raspberry Pi): https://blogs.msdn.microsoft.com/david/2017/07/20/setting_up_raspian_and_dotnet_core_2_0_on_a_raspberry_pi/

Any ideas why dotnet core throws this error?

Márton
  • 473
  • 7
  • 13
  • What does `rpm -q libicu say`? – omajid Nov 06 '17 at 14:34
  • It says the following: `[root@centos-rpi3 ~]# rpm -q libicu libicu-50.1.2-15.el7.armv7hl` – Márton Nov 07 '17 at 17:55
  • I am totally confused now. It should be picking that one up. Maybe it is looking in the wrong place. Can you try an `strace`? – omajid Nov 08 '17 at 18:26
  • According to strace dotnet core is looking for libicu version 52 or higher, which is a problem, since the highest version I could find for this particular CentOS version is 50 – Márton Nov 12 '17 at 20:52
  • For a hack, try creating a symlink for version 52 that points back to version 50. On x86_64 platforms, version 50 is picked up and used. It might work on arm too. – omajid Nov 12 '17 at 23:43
  • This was my first idea when I saw the strace, but unfortunately it did not solve the problem. Dotnet Core is looking for a function that has _52 suffix and that one cannot be found in version 50 – Márton Nov 13 '17 at 11:38
  • I would suggest filing a bug at https://github.com/dotnet/cli/, then. – omajid Nov 13 '17 at 15:20

5 Answers5

14

I had the same problem. I tried to run a self-contained dotnet core 2.0 app on an Ubuntu core. I got it work when i set the "System.Globalization.Invariant": true.

There is a File called .runtimeconfig.json

In this File you need to put the following in:

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

Then it should work.

7

I solved the problem by installing the following two packages (on ubuntu 16.04)

apt-get install libunwind8 icu-devtools
spuder
  • 17,437
  • 19
  • 87
  • 153
5

On my CentOs 7 system,i install icu library with this:

sudo yum install libicu

menxin
  • 2,044
  • 1
  • 17
  • 15
0

this worked for me:

 sudo vi /opt/microsoft/powershell/6.1.0/pwsh.runtimeconfig.json

 { "runtimeOptions": { "configProperties": { "System.Globalization.Invariant": true } } }
i255d
  • 20
  • 5
0

When running on Linux, ICU is used to get the time zone display name. It appears that CentOS 7 is not including "libicu" as well which is Required To Run dotnetcore.

Possible Solutions:

  1. Install libicu sudo yum install libicu as mentioned here
  2. Turn on Invariant Mode.
tmt
  • 2,021
  • 1
  • 10
  • 17
  • Same for CentOS 8, see https://github.com/dotnet/core/blob/master/Documentation/linux-prereqs.md for more distros – Nomada Jan 23 '20 at 13:00