I publish code to dev server and i found menu setting is error :
System.TimeZoneNotFoundException: "South Sudan Standard Time" was not found.
at TimeZoneConverter.TZConvert.GetTimeZoneInfo(String windowsOrIanaTimeZoneId)
at SuperApp.Timing.TimeZoneService.<GetWindowsTimezones>b__5_1(String tz) in C:\Works\web_source\sdb\SuperApp\src\SuperApp.Core\Timing\TimeZoneService.cs:line 61
at System.Linq.Enumerable.SelectIPartitionIterator2.PreallocatingToArray(Int32 count) at System.Linq.Enumerable.SelectIPartitionIterator
2.ToArray()
at System.Linq.Buffer1..ctor(IEnumerable
1 source)
at System.Linq.OrderedEnumerable1.ToList() at SuperApp.Timing.TimeZoneService.GetWindowsTimezones() in C:\Works\web_source\sdb\SuperApp\src\SuperApp.Core\Timing\TimeZoneService.cs:line 60 at SuperApp.Timing.TimingAppService.GetTimezoneInfos(SettingScopes defaultTimezoneScope) in C:\Works\web_source\sdb\SuperApp\src\SuperApp.Application\Timing\TimingAppService.cs:line 47 at SuperApp.Timing.TimingAppService.GetTimezoneComboboxItems(GetTimezoneComboboxItemsInput input) in C:\Works\web_source\sdb\SuperApp\src\SuperApp.Application\Timing\TimingAppService.cs:line 28 at SuperApp.Web.Areas.App.Controllers.HostSettingsController.Index() in C:\Works\web_source\sdb\SuperApp\src\SuperApp.Web.Mvc\Areas\App\Controllers\HostSettingsController.cs:line 48 at lambda_method4267(Closure, Object) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask
1 actionResultValueTask)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
how to fix it. Thank you.
6 Answer(s)
-
0
Hi devteambiz
This time zone may not be up to date in the Windows version you are currently using.
You can try changing the content of the
GetWindowsTimezones()
method in theTimeZoneService
class in the*.Core
project as follows, it may help you solve this problem.public List<NameValueDto> GetWindowsTimezones() { var timezones = new List<NameValueDto>(); var windowsTimezones = TZConvert.KnownWindowsTimeZoneIds; foreach (var windowsTimezone in windowsTimezones) { if (TZConvert.TryWindowsToIana(windowsTimezone, out var ianaTimezone)) { timezones.Add(new NameValueDto { Value = windowsTimezone, Name = $"{ianaTimezone} ({GetTimezoneOffset(TZConvert.GetTimeZoneInfo(windowsTimezone))})" }); } } return timezones.OrderBy(e => e.Name).ToList(); }
Additionally, comments here may be helpful to you.
-
0
-
0
-
0
Hi devteambiz
Could you please share the log details of the section where the error occurred?
-
0
I can't not find any error in "audit log" and "app data\ logs" My windows server version is 2019 Standard. how to fix it. you can recommand to me. thank you.
-
0
Hi,
This could be something else because as I can see, there is no Timezone section in the settings page. Could you check windows event viewer's logs if this is deployed to a windows server ?