Channing.Cloner 1.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package Channing.Cloner --version 1.0.3
                    
NuGet\Install-Package Channing.Cloner -Version 1.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Channing.Cloner" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Channing.Cloner" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="Channing.Cloner" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Channing.Cloner --version 1.0.3
                    
#r "nuget: Channing.Cloner, 1.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Channing.Cloner@1.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Channing.Cloner&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=Channing.Cloner&version=1.0.3
                    
Install as a Cake Tool

Channing.Cloner

A fast deep cloning library for .NET, supporting multi-framework targeting.

Changelog

v1.0.3 (2026-07-26)

Bug Fixes:

  • 修复 CloneTo 方法跳过只读集合属性的问题(自引用 NestedCollections 等只读集合现在能被正确克隆)

Features:

  • 新增 CloneTo 方法对只读集合属性的支持(清空目标集合并填充克隆项)
  • 新增自引用只读集合递归克隆测试(List<T> 中 T 包含自身类型的只读集合属性)
  • 新增异步克隆方法 CloneAsync的深拷贝
  • 新增源生成器支持,编译时生成克隆代码,提升性能
  • 移出AOT支持,之前版本AOT支持不完整,且性能不佳,建议使用源生成器方式

v1.0.2 (2026-07-24)

Bug Fixes:

  • 修复 CloneFieldMode.Both 模式下字段和属性合并逻辑,字段优先
  • 修复 FieldInfo 模式下自动属性的 backing field 被错误克隆的问题

Features:

  • 新增只读集合属性克隆功能(支持仅有 Add 方法而无 set 的只读属性,自动克隆集合内元素及嵌套对象)
  • 新增 CloneSettings 完整测试覆盖(CloneFieldMode、CloneDepth、OnCreateInstance)
  • 新增 CloneColumn 特性支持嵌套路径映射(如 "Child.Name")
  • 新增 CloneTo 方法递归深度保护,防止栈溢出(默认限制 100 层)
  • 重构 Value 和 ValueByType 方法,使用策略模式实现类型转换
  • 新增类型转换器:NumericTypeConverter、DateTimeTypeConverter、BoolTypeConverter、TimeSpanTypeConverter、EnumTypeConverter、GuidTypeConverter、StringTypeConverter、ByteArrayTypeConverter

v1.0.1 (2026-07-23)

Initial Release:

  • 支持对象、数组、列表、字典、匿名类型的深拷贝

  • 支持多框架目标:netcoreapp2.0、net451、netstandard2.0、netstandard1.3

  • 支持循环引用检测

  • 支持特性控制:[CloneIgnore]、[ClonePrimaryKey]、[NonCloneable]

  • Release 构建自动混淆

Features

  • Deep cloning of objects, arrays, lists, dictionaries, and anonymous types
  • Multi-framework support: netcoreapp2.0, net451, netstandard2.0, netstandard1.3
  • Source Generator support for compile-time cloning
  • Circular reference detection to prevent stack overflow
  • Attribute-based control with [CloneIgnore], [ClonePrimaryKey], [NonCloneable]
  • Code obfuscation compatible (Release builds are obfuscated with Obfuscar)

Installation

dotnet add package Channing.Cloner

Usage

using Channing.Cloner;

// Simple clone
var cloned = myObject.Clone();

// Clone with settings
var cloned = myObject.Clone(new CloneSettings { CloneDepth = CloneDepth.FirstLevelOnly });

Contact

  • Author: ChinngMou (牟成贵)
  • Email: 2538777526@qq.com
  • Blog:

License

MIT

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp1.0 was computed.  netcoreapp1.1 was computed.  netcoreapp2.0 is compatible.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard1.3 is compatible.  netstandard1.4 was computed.  netstandard1.5 was computed.  netstandard1.6 was computed.  netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net451 is compatible.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen30 was computed.  tizen40 was computed.  tizen60 was computed. 
Universal Windows Platform uap was computed.  uap10.0 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Channing.Cloner:

Package Downloads
ChanningMou.DataSearch

高性能、通用、跨框架的 C# 数据查找 / 过滤引擎。支持扁平数据、树形数据(保留结构)、流式输出与增量过滤,内置表达式树条件构建器与编译期源生成器优化。兼容 net451 ~ net8.0。

Channing.DataSearch

高性能、通用、跨框架的 C# 数据查找 / 过滤引擎。支持扁平数据、树形数据(保留结构)、流式输出与增量过滤,内置表达式树条件构建器与编译期源生成器优化。兼容 net451 ~ net8.0。

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.5 335 8/2/2026
1.0.4 130 7/30/2026
1.0.3 167 7/25/2026
1.0.2 130 7/23/2026
1.0.1 138 7/22/2026