Skip to content

CryptoUtility.ToDateTimeInvariant throws exception when Korea Standard Time is passed. #731

@BZ-CO

Description

@BZ-CO

CryptoUtility.ToDateTimeInvariant throws exception when Korea Standard Time is passed when running on Linux.

https://github.com/jjxtra/ExchangeSharp/blob/786de5e495b51a9c3b90608a794725525c9e04e5/src/ExchangeSharp/Utility/CryptoUtility.cs#L218

System.TypeInitializationException: The type initializer for 'ExchangeSharp.CryptoUtility' threw an exception.
---> System.TimeZoneNotFoundException: The time zone ID 'Korea Standard Time' was not found on the local computer.
---> System.IO.FileNotFoundException: Could not find file '/usr/share/zoneinfo/Korea Standard Time'.
File name: '/usr/share/zoneinfo/Korea Standard Time'
at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
at System.IO.FileStream.OpenHandle(FileMode mode, FileShare share, FileOptions options)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at Internal.IO.File.ReadAllBytes(String path)
at System.TimeZoneInfo.TryGetTimeZoneFromLocalMachine(String id, TimeZoneInfo& value, Exception& e)
--- End of inner exception stack trace ---
at System.TimeZoneInfo.FindSystemTimeZoneById(String id)
at ExchangeSharp.CryptoUtility..cctor()
--- End of inner exception stack trace ---
at ExchangeSharp.CryptoUtility.get_UtcNow()
at ExchangeSharp.MemoryCache.TimerCallback(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.TimerQueueTimer.CallCallback(Boolean isThreadPool)
at System.Threading.TimerQueueTimer.Fire(Boolean isThreadPool)
at System.Threading.TimerQueue.FireNextTimers()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions