Skip to content

Commit

Permalink
Fix TimeZones Test failure (dotnet#60140)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarekgh authored Oct 7, 2021
1 parent d2d98f0 commit eff8883
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3110,6 +3110,14 @@ private static unsafe int EnumUiLanguagesCallback(char* lpUiLanguageString, IntP
// native string is null terminated
var cultureName = new string(lpUiLanguageString);

string tzResourceFilePath = Path.Join(Environment.SystemDirectory, cultureName, "tzres.dll.mui");
if (!File.Exists(tzResourceFilePath))
{
// If Windows installed a UI language but did not include the time zone resources DLL for that language,
// then skip this language as .NET will not be able to get the localized resources for that language.
return 1;
}

try
{
var handle = GCHandle.FromIntPtr(lParam);
Expand Down

0 comments on commit eff8883

Please sign in to comment.