From 817cb1d24ee661a6d529318dc35181328869a7bd Mon Sep 17 00:00:00 2001 From: rstefko Date: Fri, 26 Jan 2024 15:46:06 +0100 Subject: [PATCH] Allow run in sandbox, fixes 'Intuit.Ipp.Exception.IdsException.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)'. Security accessibility of the overriding method must match the security accessibility of the method being overriden. --- .../Code/Intuit.Ipp.Exception/IdsError.cs | 17 ++++++++++++++++- .../Code/Intuit.Ipp.Exception/IdsException.cs | 18 +++++++++++++++++- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/IPPDotNetDevKitCSV3/Code/Intuit.Ipp.Exception/IdsError.cs b/IPPDotNetDevKitCSV3/Code/Intuit.Ipp.Exception/IdsError.cs index e3fa31d1..502f3d7e 100644 --- a/IPPDotNetDevKitCSV3/Code/Intuit.Ipp.Exception/IdsError.cs +++ b/IPPDotNetDevKitCSV3/Code/Intuit.Ipp.Exception/IdsError.cs @@ -26,7 +26,7 @@ namespace Intuit.Ipp.Exception /// TODO: Update summary. /// [System.Serializable] - public class IdsError : System.Exception + public class IdsError : System.Exception, ISafeSerializationData { /// /// Error Code. @@ -148,6 +148,7 @@ public string Detail } } +#if NETCORE /// /// Contains the System.Runtime.Serialization.SerializationInfo with information about the exception. /// @@ -165,5 +166,19 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont info.AddValue("detail", this.detail); } } +#endif + + /// + /// This method is called when the instance is deserialized. + /// + /// An object that contains the state of the instance. + public void CompleteDeserialization(object deserialized) + { + IdsError exception = (IdsError)deserialized; + exception.errorCode = this.errorCode; + exception.errorMessage = this.errorMessage; + exception.element = this.element; + exception.detail = this.detail; + } } } diff --git a/IPPDotNetDevKitCSV3/Code/Intuit.Ipp.Exception/IdsException.cs b/IPPDotNetDevKitCSV3/Code/Intuit.Ipp.Exception/IdsException.cs index 17b8dfa9..1bcf7580 100644 --- a/IPPDotNetDevKitCSV3/Code/Intuit.Ipp.Exception/IdsException.cs +++ b/IPPDotNetDevKitCSV3/Code/Intuit.Ipp.Exception/IdsException.cs @@ -29,7 +29,7 @@ namespace Intuit.Ipp.Exception /// Represents an IdsException. /// [System.Serializable] - public class IdsException : System.Exception + public class IdsException : System.Exception, ISafeSerializationData { /// /// Error Code. @@ -283,6 +283,7 @@ public ReadOnlyCollection InnerExceptions } } +#if NETCORE /// /// Contains the System.Runtime.Serialization.SerializationInfo with information about the exception. /// @@ -301,5 +302,20 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont info.AddValue("innerExceptions", this.innerExceptions); } } +#endif + + /// + /// This method is called when the instance is deserialized. + /// + /// An object that contains the state of the instance. + public void CompleteDeserialization(object deserialized) + { + IdsException exception = (IdsException)deserialized; + exception.errorCode = this.errorCode; + exception.errorMessage = this.errorMessage; + exception.source = this.source; + exception.innerException = this.innerException; + exception.innerExceptions = this.innerExceptions; + } } }