Stashbox by Peter Csajtai

<PackageReference Include="Stashbox" Version="5.0.0-preview-717" />

 CircularDependencyException

Represents the exception the container throws when a circular dependency is found.
using Stashbox.Utils; using System; using System.Runtime.Serialization; namespace Stashbox.Exceptions { [Serializable] public class CircularDependencyException : Exception { public Type Type { get; } public CircularDependencyException(Type type, Exception innerException = null) : base("Circular dependency detected during the resolution of " + type.FullName + ".", innerException) { Type = type; } protected CircularDependencyException(SerializationInfo info, StreamingContext context) : base(info, context) { Type = (Type)info.GetValue("Type", typeof(Type)); } public override void GetObjectData(SerializationInfo info, StreamingContext context) { Shield.EnsureNotNull(info, "info"); info.AddValue("Type", Type, typeof(Type)); base.GetObjectData(info, context); } } }