dotnet / core

.NET news, announcements, release notes, and more!
https://dot.net
MIT License
20.87k stars 4.88k forks source link

linux centos 6.5 install sdk 2.2 #4481

Open 3133 opened 4 years ago

3133 commented 4 years ago

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.StringComparer..cctor() at System.AppDomain.InitializeCompatibilityFlags() at System.AppDomain.Setup(System.Object)

maxild commented 4 years ago

I know this issue have come up before, and I know the issue is documented here

Can someone explain why I get the above error when running a self-contained (cross-compiled) package on linux

dotnet publish  --self-contained --configuration Release --output ./artifacts --runtime linux-x64 -p:PublishSingleFile=true ./src/FFV-RTL.Console/FFV-RTL.Console.csproj

But when I build the same codebase (with the same sdk/runtime)

dotnet pack  --configuration Release --output ./artifacts ./src/FFV-RTL.Console/FFV-RTL.Console.csproj

my application works fine (after installation as global/local tool). BTW on windows (and mac os x, I think, have to check) both self-contained and normal CLI app builds work.

And my application uses System.Globalization so I cannot use DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true in the shell, because then a lot of parsing locale data (money, dates) doesn't work.