Adi Jian
Adi Jian

Reputation: 11

Jenkins - Couldn't find a valid ICU package installed on the system

I have a Microk8s cluster running Jenkins and I'm trying to test building a .NET Core software and run dotnet test on it.

I'm getting this error: 'Couldn't find a valid ICU package installed on the system. Please install libicu using your package manager and try again. Alternatively you can set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support.'

I tried adding to the .csproj the 'InvariantGlobalization' and remove /bin /obj folders but I still get this error.

I tried adding a shell command to upgrade the libicu package but jenkins user is not an admin and I can't get it to be admin.

Upvotes: 0

Views: 1118

Answers (1)

ZackR
ZackR

Reputation: 73

Hey so I know this is a bit old but I ran into this same problem and managed to fix it by wrapping the dotnet test command in the Jenkinsfile like this

withEnv(['DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1']) {
  dotnet test ...
}

This adds the DOTNET_SYSTEM_GLOBALIZATION_INVARIANT env var (documented here https://learn.microsoft.com/en-us/dotnet/core/runtime-config/globalization#invariant-mode) temporally to your Jenkins environment

Upvotes: 0

Related Questions