Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

menu setting is error about TimeZone "South Sudan Standard Time" was not found. #12118


User avatar
0
devteambiz created

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.SelectIPartitionIterator2.ToArray() at System.Linq.Buffer1..ctor(IEnumerable1 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, ValueTask1 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)
  • User Avatar
    0
    oguzhanagir created
    Support Team

    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 the TimeZoneService 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.

  • User Avatar
    0
    devteambiz created

    Thank you. your code still error. I added "try catch " in your code.can fix it.

  • User Avatar
    0
    devteambiz created

    Dear sir, when i added try{}catch{} menu settings not error but cann't save all. how to fix it. Thank you.

  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi devteambiz

    Could you please share the log details of the section where the error occurred?

  • User Avatar
    0
    devteambiz created

    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.

  • User Avatar
    0
    ismcagdas created
    Support Team

    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 ?