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.)