Skip to content

Commit eff8883

Browse files
authored
Fix TimeZones Test failure (#60140)
1 parent d2d98f0 commit eff8883

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/libraries/System.Runtime/tests/System/TimeZoneInfoTests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3110,6 +3110,14 @@ private static unsafe int EnumUiLanguagesCallback(char* lpUiLanguageString, IntP
31103110
// native string is null terminated
31113111
var cultureName = new string(lpUiLanguageString);
31123112

3113+
string tzResourceFilePath = Path.Join(Environment.SystemDirectory, cultureName, "tzres.dll.mui");
3114+
if (!File.Exists(tzResourceFilePath))
3115+
{
3116+
// If Windows installed a UI language but did not include the time zone resources DLL for that language,
3117+
// then skip this language as .NET will not be able to get the localized resources for that language.
3118+
return 1;
3119+
}
3120+
31133121
try
31143122
{
31153123
var handle = GCHandle.FromIntPtr(lParam);

0 commit comments

Comments
 (0)