From 9ba6a2bbcc07056f491724f8bee92c8117da7e72 Mon Sep 17 00:00:00 2001 From: dadhi Date: Mon, 25 Mar 2019 11:39:34 +0300 Subject: [PATCH] fixed: #95 Serializable ContainerException for supported targets --- src/DryIoc/Container.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/DryIoc/Container.cs b/src/DryIoc/Container.cs index f7edeef8c..5ed86337f 100644 --- a/src/DryIoc/Container.cs +++ b/src/DryIoc/Container.cs @@ -10219,10 +10219,12 @@ public Meta(T value, TMetadata metadata) } } - /// Exception that container throws in case of error. Dedicated exception type simplifies - /// filtering or catching container relevant exceptions from client code. - [SuppressMessage("Microsoft.Usage", "CA2237:MarkISerializableTypesWithSerializable", - Justification = "Not available in PCL.")] + /// Exception that container throws in case of error. Dedicated exception type simplifies + /// filtering or catching container relevant exceptions from client code. +#if !NETSTANDARD1_0 && !NETSTANDARD1_3 && !PCL + [Serializable] +#endif + [SuppressMessage("Microsoft.Usage", "CA2237:MarkISerializableTypesWithSerializable", Justification = "Not available in PCL.")] public class ContainerException : InvalidOperationException { /// Error code of exception, possible values are listed in class. @@ -10258,6 +10260,11 @@ public ContainerException(int errorCode, string message, Exception innerExceptio /// Creates exception with message describing cause and context of error. public ContainerException(int error, string message) : this(error, message, null) { } + +#if !NETSTANDARD1_0 && !NETSTANDARD1_3 && !PCL + protected ContainerException(SerializationInfo info, StreamingContext context) + : base(info, context) {} +#endif } /// Defines error codes and error messages for all DryIoc exceptions (DryIoc extensions may define their own.)