TUtility 2.0.56

dotnet add package TUtility --version 2.0.56
                    
NuGet\Install-Package TUtility -Version 2.0.56
                    
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="TUtility" Version="2.0.56" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TUtility" Version="2.0.56" />
                    
Directory.Packages.props
<PackageReference Include="TUtility" />
                    
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 TUtility --version 2.0.56
                    
#r "nuget: TUtility, 2.0.56"
                    
#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 TUtility@2.0.56
                    
#: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=TUtility&version=2.0.56
                    
Install as a Cake Addin
#tool nuget:?package=TUtility&version=2.0.56
                    
Install as a Cake Tool

<p align="center"> <img src="logo.svg" width="400" height="200" alt="TUtility Logo" /> </p>

<h1 align="center">TUtility - .NET 基础工具库</h1>

<div align="center">

License NuGet .NET

ThingsGateway 生态的通用基础设施、应用启动约定和编译期工具。

</div>

项目简介

TUtility 面向高并发、低分配和 AOT 场景,提供通用数据结构、异步原语、调度、日志、序列化、结果模型与协议辅助工具。应用宿主相关能力独立放在 TUtility.App,分析器和源生成器也以单独包发布,使用者可以按需引用。

项目组成

模块 路径 说明
TUtility src/TUtility 通用类型、集合、缓存、异步原语、调度、日志、JSON 和帮助类
TUtility.App src/TUtility.App 模块化启动、配置加载、托管服务与应用选项
TUtility.Analyzer analyzer/TUtility.Analyzer 编译期代码质量和性能诊断
TUtility.Generator analyzer/TUtility.Generator AppStartup 编译期发现与启动代码生成
自动化测试 test/TUtility.Test 核心集合、并发、安全、转换和调度测试
性能测试 benchmark/TUtility.Benchmark BenchmarkDotNet 基准项目

核心能力

  • 结果模型:OperResultOperResult<T>、分页输入和 PagedList<T>
  • 高性能集合:对象池、空闲对象池、过期字典、内存缓存和 UltraMpscQueue<T>
  • 并发工具:异步读写锁、异步自动重置事件、并发限制器和等待锁。
  • 调度能力:Cron、同步/异步计划任务、TimerX 和智能触发调度器。
  • 数据处理:字节、位、BCD、CRC、编码、路径、文件、LINQ 和表达式筛选辅助工具。
  • 安全能力:JWT、RSA、对称加密、哈希和校验算法。
  • 序列化:基于 System.Text.Json 的统一服务、上下文和常用类型转换器。
  • 日志与运行信息:控制台/文本日志、日志读取、机器信息和运行时环境辅助。
  • 应用启动:按顺序加载 AppStartup,由源生成器完成编译期注册。

安装

只使用核心工具:

dotnet add package TUtility

需要模块化应用启动和配置能力:

dotnet add package TUtility.App
dotnet add package TUtility.Generator

需要编译期诊断:

dotnet add package TUtility.Analyzer

项目结构

TUtility/
|-- analyzer/
|   |-- TUtility.Analyzer/
|   `-- TUtility.Generator/
|-- src/
|   |-- TUtility/
|   `-- TUtility.App/
|-- test/TUtility.Test/
|-- benchmark/TUtility.Benchmark/
|-- Directory.Build.props
`-- TUtility.slnx

构建与测试

dotnet restore TUtility.slnx
dotnet build TUtility.slnx -c Release
dotnet test test/TUtility.Test/TUtility.Test.csproj -c Release

Release 构建会生成 NuGet 包并输出到上级 nupkgs 目录。

致谢

相关资源

  • 官方文档:https://runtime.thingsgateway.cn/
  • Gitee:https://gitee.com/diego2098/ThingsGateway
  • GitHub:https://github.com/kimdiego2098/ThingsGateway
  • QQ 群:605534569

许可证

本项目使用 Apache-2.0 协议。

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on TUtility:

Package Downloads
TORM

TORM 是一个为 .NET 平台设计的轻量级、高性能 ORM(对象关系映射)框架。提供了简洁流畅的 API,支持多种数据库,并针对高性能场景进行了深度优化。 数据库驱动请按需引用对应的子包:TORM.Sqlite、TORM.MySql、TORM.SqlServer、TORM.PostgreSql、TORM.QuestDb。

TUtility.App

TUtility 是一个轻量级、高性能、功能丰富的 .NET 工具库。提供模块化启动系统、操作结果模式、高性能内存缓存、对象池、池化异步任务、定时任务调度、安全算法、雪花ID生成器、JSON序列化扩展等功能。

TExcel

TExcel 是一个轻量级、高性能、低内存占用的 Excel 读写库,支持 AOT 编译。提供流式操作,支持导出实体列表、多 Sheet、字典,以及导入 Sheet、获取 Sheet 列表、逐行读取等功能。无需任何第三方依赖。

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.56 83 7/23/2026
2.0.55 362 7/14/2026
2.0.54 380 7/12/2026
2.0.53 426 7/8/2026
2.0.52 365 7/7/2026
2.0.51 659 7/2/2026
2.0.50 466 6/25/2026
2.0.49 751 6/22/2026
2.0.48 524 6/17/2026
2.0.47 726 6/11/2026
2.0.46 537 6/8/2026
2.0.45 346 6/5/2026
2.0.44 317 6/4/2026
2.0.43 723 6/3/2026
2.0.41 340 6/1/2026
2.0.40 337 5/29/2026
2.0.39 412 5/29/2026
2.0.38 485 5/27/2026
2.0.35 410 5/25/2026
2.0.34 273 5/24/2026
Loading failed