gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-03 17:12:54 25 4
gpt4 key购买 nike

我正在尝试在运行 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 运行时):https://blogs.msdn.microsoft.com/david/2017/07/20/setting_up_raspian_and_dotnet_core_2_0_on_a_raspberry_pi/

知道为什么 dotnet core 会抛出这个错误吗?

最佳答案

我遇到了同样的问题。我试图在 Ubuntu 核心上运行一个独立的 dotnet 核心 2.0 应用程序。当我设置“System.Globalization.Invariant”时,我得到了它的工作:true。

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

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

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

那么它应该可以工作了。

关于centos - 使用 CentOS UserLand 在 Raspberry Pi3 上运行 dotnet 核心应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47111844/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com