Skip to content

Commit

Permalink
Ensure that ICU is loaded in tests before checking its version (#96288)
Browse files Browse the repository at this point in the history
Fixes #96279
  • Loading branch information
jkotas committed Dec 25, 2023
1 parent 73c7673 commit 9cc490e
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,9 @@ private static Version GetICUVersion()
MethodInfo methodInfo = interopGlobalization.GetMethod("GetICUVersion", BindingFlags.NonPublic | BindingFlags.Static);
if (methodInfo != null)
{
// Ensure that ICU has been loaded
GC.KeepAlive(System.Globalization.CultureInfo.InstalledUICulture);

version = (int)methodInfo.Invoke(null, null);
}
}
Expand Down

0 comments on commit 9cc490e

Please sign in to comment.