Time zone and Registry access
description
I encountered an issue in that, registry access for time zone handling causes security exceptions.
Here is the main message:
"Requested registry access is not allowed."
The top of the stack trace is:
at System.ThrowHelper.ThrowSecurityException(ExceptionResource resource)
at Microsoft.Win32.RegistryKey.InternalOpenSubKey(String name, RegistryKeyPermissionCheck permissionCheck, Int32 rights)
at Microsoft.Win32.RegistryKey.OpenSubKey(String name, RegistryKeyPermissionCheck permissionCheck, RegistryRights rights)
at System.TimeZoneInfo.TryGetTimeZoneByRegistryKey(String id, TimeZoneInfo& value, Exception& e)
at System.TimeZoneInfo.TryGetTimeZone(String id, Boolean dstDisabled, TimeZoneInfo& value, Exception& e, CachedData cachedData)
at System.TimeZoneInfo.GetLocalTimeZone(CachedData cachedData)
at System.TimeZoneInfo.CachedData.CreateLocal()
at System.TimeZoneInfo.get_Local()
at Newtonsoft.Json.Utilities.DateTimeUtils.GetUtcOffset(DateTime d)