You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unhandled Exception: System.Runtime.Serialization.SerializationException: An error occurred while deserializing the object. The serialized data is corrupt. ---> System.InvalidTimeZoneException: The elements of the AdjustmentRule array must be in chronological order and must not overlap.
at System.TimeZoneInfo.ValidateTimeZoneInfo(String id, TimeSpan baseUtcOffset, AdjustmentRule[] adjustmentRules, Boolean& adjustmentRulesSupportDst)
at System.TimeZoneInfo..ctor(String id, TimeSpan baseUtcOffset, String displayName, String standardDisplayName, String daylightDisplayName, AdjustmentRule[] adjustmentRules, Boolean disableDaylightSavingTime)
at System.TimeZoneInfo.StringSerializer.GetDeserializedTimeZoneInfo(String source)
--- End of inner exception stack trace ---
at System.TimeZoneInfo.StringSerializer.GetDeserializedTimeZoneInfo(String source)
The problem is - some (well, almost all of them) adjustment rules are overlapped, run this to find out which ones:
@EgorBo yes we are aware of some limitation of the serialization functionality/Adjustment rules on Linux. I am wondering in what scenario you are trying to serialize and de-serialize the time zones? I would say the best practice is to serialize the time zone Id only and use this Id to reconstruct the time zone object again.
Given @tarekgh's suggestion above and the lack of activity here I'll go ahead and close this one for now. If the suggestion doesn't work or you disagree feel free to reopen.
Run the following code snippet on macOS:
Expected:
no exceptions (just like on Windows).
Actual:
The problem is - some (well, almost all of them) adjustment rules are overlapped, run this to find out which ones:
so the first snippet crashes here: https://github.com/dotnet/coreclr/blob/030a3ea9b8dbeae89c90d34441d4d9a1cf4a7de6/src/System.Private.CoreLib/shared/System/TimeZoneInfo.cs#L1974-L1978
Possible fixes:
<=
to<
The text was updated successfully, but these errors were encountered: