Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run dotnet core application on Raspberry Pi3 with CentOS UserLand

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?

like image 793
Márton Avatar asked Nov 04 '17 14:11

Márton


People also ask

Can .NET Core run on Raspberry Pi?

NET Core on Raspberry Pi. . NET Core SDK is available on ARM32/ARM64 which is used by Raspberry Pi but many users have reported it's more convenient to cross build (i.e. dotnet publish -r linux-arm ) binaries from desktop as it allows for much faster iteration cycle.

Can we run .NET Core on Linux?

Supported Platform: Windows® (Authoring), Linux® (Execution), and macOS (Execution). This example shows how to create a . NET assembly using the Library Compiler and integrate it into a . NET Core application that can run on Linux or macOS.


3 Answers

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.

like image 190
dieter HANSEN Avatar answered Oct 15 '22 21:10

dieter HANSEN


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

apt-get install libunwind8 icu-devtools
like image 28
spuder Avatar answered Oct 15 '22 23:10

spuder


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

sudo yum install libicu

like image 5
menxin Avatar answered Oct 15 '22 22:10

menxin