Running dotnet run command throws error Couldn't find a valid ICU package installed on the system

I was using .net core 3.1 on Ubuntu 20.04 for a while but now after a system update the skd does not seem to recognize the installed libicu. I am currently on dotnet 3.1.407.

dotnet run 

Error Message: 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()

I verified that this is installed.

ii libicu66:amd64 66.1-2ubuntu2 amd64 International Components for Unicode

Interestingly and when running the Application Test directly it works -> dotnet bin/Debug/netcoreapp3.1/Test.dll

There a some suggestions out there to set the the Globalization.Invariant to true,

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

which works but is not applicable to my situation as that prevents EntityFramework from connecting to the SQL Database -> Globalization.Invariant is not supported.

dotnet info output:

NET Core SDK (reflecting any global.json): Version: 3.1.407 Commit: d3244d0e44

Runtime Environment: OS Name: ubuntu OS Version: 20.04 OS Platform: Linux RID: ubuntu.20.04-x64 Base Path: /snap/dotnet-sdk/117/sdk/3.1.407/

Host (useful for support): Version: 3.1.13 Commit: 64df28ec4a

.NET Core SDKs installed: 3.1.407 [/snap/dotnet-sdk/117/sdk]

.NET Core runtimes installed: Microsoft.AspNetCore.App 3.1.13 [/snap/dotnet-sdk/117/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.13 [/snap/dotnet-sdk/117/shared/Microsoft.NETCore.App]

Any tips to fix this are highly appreciated.

1

1 Answer

After all, it turns out to be a problem with the Snap installation of the .NET SDK. I uninstalled the snap package and installed .net 3.1 SDK binary directly as instructed on this page microsoft .net installation. Scroll down to the chapter "manual installation". Download the binary and install the SDK. My programs builds and run fine again.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like