Fix serialization of several exception types
authorStephen Toub <stoub@microsoft.com>
Thu, 18 Aug 2016 18:05:35 +0000 (14:05 -0400)
committerStephen Toub <stoub@microsoft.com>
Thu, 18 Aug 2016 18:05:35 +0000 (14:05 -0400)
VerificationException's deserialization ctor was being tree-shaken away.

SecurityException's deserialization ctor was ifdef'd out.

Commit migrated from https://github.com/dotnet/coreclr/commit/f4fdd63a3bb4c4769fc42a68b6de7cfa525f4787

src/coreclr/src/mscorlib/model.xml
src/coreclr/src/mscorlib/ref/mscorlib.cs
src/coreclr/src/mscorlib/src/System/Security/SecurityException.cs

index e5db284..71fa743 100644 (file)
       <Member Name="#ctor" />
       <Member Name="#ctor(System.String)" />
       <Member Name="#ctor(System.String,System.Exception)" />
+      <Member Name="#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)" />
     </Type>
     <Type Name="System.Security.SecurityState">
       <Member Name="#ctor" />
       <Member Name="#ctor" />
       <Member Name="#ctor(System.String)" />
       <Member Name="#ctor(System.String,System.Exception)" />
+      <Member Name="#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)" />
     </Type>
     <Type Status="ImplRoot" Name="System.SharedStatics">
       <Member MemberType="Field"  Name="_sharedStatics" /> <!-- EE -->
index aadae50..abb6bdd 100644 (file)
@@ -11267,6 +11267,7 @@ namespace System.Security
         public SecurityException() { }
         public SecurityException(string message) { }
         public SecurityException(string message, System.Exception inner) { }
+        protected SecurityException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
         [System.Security.SecurityCriticalAttribute]
         public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
         public override string ToString() { throw null; }
@@ -11301,6 +11302,7 @@ namespace System.Security
         public VerificationException() { }
         public VerificationException(string message) { }
         public VerificationException(string message, System.Exception innerException) { }
+        protected VerificationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
     }
 }
 namespace System.Security.Permissions
index 303e897..9fbd802 100644 (file)
@@ -600,7 +600,15 @@ namespace System.Security
         
         internal SecurityException(string message, Object deny, Object permitOnly, MethodInfo method, Object demanded, IPermission permThatFailed)
                     : this(){}
-                    
+
+        [System.Security.SecuritySafeCritical]  // auto-generated
+        protected SecurityException(SerializationInfo info, StreamingContext context) : base(info, context)
+        {
+            if (info == null)
+                throw new ArgumentNullException("info");
+            Contract.EndContractBlock();
+        }
+
         public override String ToString() 
                 {
                     return base.ToString();