Channing.Cloner
1.0.2
.NET Core 2.0
This package targets .NET Core 2.0. The package is compatible with this framework or higher.
.NET Standard 1.3
This package targets .NET Standard 1.3. The package is compatible with this framework or higher.
.NET Framework 4.5.1
This package targets .NET Framework 4.5.1. The package is compatible with this framework or higher.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Channing.Cloner --version 1.0.2
NuGet\Install-Package Channing.Cloner -Version 1.0.2
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.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Channing.Cloner" Version="1.0.2" />
<PackageReference Include="Channing.Cloner" />
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.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Channing.Cloner, 1.0.2"
#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.2
#: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.2
#tool nuget:?package=Channing.Cloner&version=1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Channing.Cloner
A fast deep cloning library for .NET, supporting multi-framework targeting and AOT compilation.
Changelog
v1.0.2 (2026-07-24)
Bug Fixes:
- 修复
CloneFieldMode.Both模式下字段和属性合并逻辑,字段优先 - 修复
.NET Framework 4.5.1编译错误:AsyncLocal<T>类型不存在,改用[ThreadStatic] - 修复
.NET Framework 4.5.1编译错误:Array.Empty<T>()不存在,改用new T[0] - 修复
.NET Standard 1.3编译错误:Type.IsValueType不存在,改用Type.GetTypeInfo().IsValueType - 修复
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 - 新增单元测试 41 个,覆盖所有公共 API 和边缘场景
v1.0.1 (2026-07-23)
Initial Release:
- 支持对象、数组、列表、字典、匿名类型的深拷贝
- 支持多框架目标:netcoreapp2.0、net451、netstandard2.0、netstandard1.3
- 支持 AOT 编译
- 支持循环引用检测
- 支持特性控制:
[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
- AOT compilation support via conditional compilation
- 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 | Versions 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.
-
.NETCoreApp 2.0
- No dependencies.
-
.NETFramework 4.5.1
- No dependencies.
-
.NETStandard 1.3
- NETStandard.Library (>= 1.6.1)
- System.Dynamic.Runtime (>= 4.3.0)
-
.NETStandard 2.0
- System.Reflection.Emit (>= 4.3.0)
- System.Reflection.Emit.Lightweight (>= 4.3.0)
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.