Deep-clone any .NET object — or copy into another. Super easy, very fast, and it just works across the graphs you actually use. Free and open source from the makers of ETLBox.
Cycles blow the stack. ExpandoObject comes back sharing nested instances. Dictionaries lose their key types. Mappers and JSON round-trips were never cloners — they just look like one until you check the result.
CloneBox is built for the hard cases, with an API that stays tiny: CloneX() for a deep copy, CloneXTo() for copying into a target.
usingCloneBox;varcustomer=newCustomer{Id=1,Name="Ada",Address=newAddress{City="Berlin"}};varcopy=customer.CloneX();// copy is a new Customer; Address is a new instance too
Or clone into another object
CloneXTo() copies matching members onto a different type or onto an instance you already have. Extra fields on the target stay unchanged.
varsource=newCustomer{Id=1,Name="Ada",Address=newAddress{City="Berlin"}};vardto=newCustomerDto{ExtraOnTarget="keep-me"};source.CloneXTo(dto);// dto.Id / Name / Address filled; ExtraOnTarget still "keep-me"
Install from NuGet and you are done — no license key, no trial, no setup beyond the package reference.
Real deep clones
CloneX() copies nested objects, collections, arrays, and dictionaries — including cycles — without shared identity.
Clone into existing objects
CloneXTo() fills a different type or an instance you already have. Extra target fields stay put.
Dynamics included
ExpandoObject and mixed graphs work the same way as typed POCOs — including clone-into a DTO.
Very fast
Built for hot paths. Competitive with specialized cloners on simple graphs — and still correct when the graph gets hard.
Benchmarks at a glance
Release / net10.0. A time is only listed when the result was correct — — means wrong output or a crash.