Click here to Skip to main content
14,733,443 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Problem encountered on https://dotnet.microsoft.com/learn/dotnet/hello-world-tutorial/run
Operating System: Linux


What I have tried:

dotnet run
Process terminated. 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.CultureInfo..cctor()
at System.String.ToLowerInvariant()
at System.Text.EncodingHelper.GetCharset()
at System.Text.EncodingHelper.GetEncodingFromCharset()
at System.ConsolePal.GetConsoleEncoding()
at System.Console+<>c.<get_OutputEncoding>b__19_0()
at System.Threading.LazyInitializer.EnsureInitializedCore[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon ByRef, System.Object ByRef, System.Func1<System.__Canon>) at System.Threading.LazyInitializer.EnsureInitialized[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon ByRef, System.Object ByRef, System.Func1<System.__Canon>)
at System.Console.get_OutputEncoding()
at System.Console.CreateOutputWriter(System.IO.Stream)
at System.Console+<>c.<get_Out>b__26_0()
at System.Threading.LazyInitializer.EnsureInitializedCore[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon ByRef, System.Object ByRef, System.Func1<System.__Canon>) at System.Threading.LazyInitializer.EnsureInitialized[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon ByRef, System.Object ByRef, System.Func1<System.__Canon>)
at System.Console.get_Out()
at System.Console.WriteLine(System.String)
at myApp.Program.Main(System.String[])
Posted
Updated 4-Aug-20 20:54pm

1 solution

Seems it's a documented error here core/build-and-install-rhel6-prerequisites.md at master · dotnet/core · GitHub[^]

It's shared here as:
Quote:
The ICU libraries were not extracted from icu4c-57_1-RHEL6-x64.tgz to the right place, or LD_LIBRARY_PATH was not set to /usr/local/lib. See the Making the libraries available for a .NET Core application section[^].


I see following being suggested by a lot for fixing based on above:
Edit the generated runtimeconfig.json after following this documentation
core/build-and-install-rhel6-prerequisites.md at master · dotnet/core · GitHub[^]
{
    "runtimeOptions": {
        "configProperties": {
            "System.Globalization.Invariant": true
        },
    }
}
   
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900