Passing settings

var clone = source.CloneX(new CloneSettings {
    IncludeNonPublicFields = false,
    IncludeNonPublicProperties = false,
    UseICloneableClone = true,
    Logger = logger   // Microsoft.Extensions.Logging
});

The same object works with CloneXTo():

source.CloneXTo(target, settings);

Visibility

SettingDefaultMeaning
IncludePublicPropertiestrueCopy public properties
IncludeNonPublicPropertiestrueCopy non-public properties
IncludePublicFieldstrueCopy public fields
IncludeNonPublicFieldstrueCopy non-public fields
IncludePublicConstructorstrueAllow public constructors when creating instances
IncludeNonPublicConstructorstrueAllow non-public constructors when needed

ICloneable

ICloneable is ignored unless you opt in:

UseICloneableClone = true

When enabled, CloneBox may call ICloneable.Clone() for types that implement it.

Skip predicates

See Skip members for DoNotCloneProperty, DoNotCloneField, and DoNotCloneClass.

Logging

Set Logger to an ILogger from Microsoft.Extensions.Logging if you want diagnostics while cloning.