TUtility.App 2.0.58

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

Showing the top 4 NuGet packages that depend on TUtility.App:

Package Downloads
ThingsGatewayRuntime.Foundation

Package Description

ThingsGatewayRuntime.Application

Package Description

ThingsGatewayRuntime.Admin

Package Description

TAdmin

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.58 0 8/3/2026
2.0.57 63 7/31/2026
2.0.56 295 7/23/2026
2.0.55 194 7/14/2026
2.0.54 205 7/12/2026
2.0.53 256 7/8/2026
2.0.52 187 7/7/2026
2.0.51 491 7/2/2026
2.0.50 287 6/25/2026
2.0.49 575 6/22/2026
2.0.48 345 6/17/2026
2.0.47 545 6/11/2026
2.0.46 357 6/8/2026
2.0.45 169 6/5/2026
2.0.44 298 6/4/2026
2.0.43 419 6/3/2026
2.0.41 179 6/1/2026
2.0.40 166 5/29/2026
2.0.39 253 5/29/2026
2.0.38 306 5/27/2026
Loading failed