summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorgan Brown <morganbr@users.noreply.github.com>2017-06-01 05:09:07 -0700
committerViktor Hofer <viktor.hofer@microsoft.com>2017-06-01 14:09:07 +0200
commitbeaefc2188a4cf46c99e522f4ed0b57507b07633 (patch)
tree6d0dfaa887db041dc9948a602b267cea9a2af28f
parent567c9aaf4bdb1ce3709decd46105ee7c4c4faf9f (diff)
downloadcoreclr-beaefc2188a4cf46c99e522f4ed0b57507b07633.tar.gz
coreclr-beaefc2188a4cf46c99e522f4ed0b57507b07633.tar.bz2
coreclr-beaefc2188a4cf46c99e522f4ed0b57507b07633.zip
Fixes deserializaing TimeZoneInfo by putting back the IDeserializationCallback.OnDeserialization method. (#12024)
-rw-r--r--src/mscorlib/src/System/TimeZoneInfo.cs19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/mscorlib/src/System/TimeZoneInfo.cs b/src/mscorlib/src/System/TimeZoneInfo.cs
index 3450311835..8ed7e229c0 100644
--- a/src/mscorlib/src/System/TimeZoneInfo.cs
+++ b/src/mscorlib/src/System/TimeZoneInfo.cs
@@ -1012,7 +1012,24 @@ namespace System
void IDeserializationCallback.OnDeserialization(object sender)
{
- throw new PlatformNotSupportedException();
+ try
+ {
+ bool adjustmentRulesSupportDst;
+ ValidateTimeZoneInfo(_id, _baseUtcOffset, _adjustmentRules, out adjustmentRulesSupportDst);
+
+ if (adjustmentRulesSupportDst != _supportsDaylightSavingTime)
+ {
+ throw new SerializationException(SR.Format(SR.Serialization_CorruptField, "SupportsDaylightSavingTime"));
+ }
+ }
+ catch (ArgumentException e)
+ {
+ throw new SerializationException(SR.Serialization_InvalidData, e);
+ }
+ catch (InvalidTimeZoneException e)
+ {
+ throw new SerializationException(SR.Serialization_InvalidData, e);
+ }
}
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)