ThingsGatewayRuntime.Plugin
2.1.32
dotnet add package ThingsGatewayRuntime.Plugin --version 2.1.32
NuGet\Install-Package ThingsGatewayRuntime.Plugin -Version 2.1.32
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="ThingsGatewayRuntime.Plugin" Version="2.1.32" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ThingsGatewayRuntime.Plugin" Version="2.1.32" />
<PackageReference Include="ThingsGatewayRuntime.Plugin" />
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 ThingsGatewayRuntime.Plugin --version 2.1.32
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ThingsGatewayRuntime.Plugin, 2.1.32"
#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 ThingsGatewayRuntime.Plugin@2.1.32
#: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=ThingsGatewayRuntime.Plugin&version=2.1.32
#tool nuget:?package=ThingsGatewayRuntime.Plugin&version=2.1.32
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ThingsGatewayRuntime
ThingsGatewayRuntime 是 ThingsGateway 的工业物联网边缘网关运行时,负责设备采集、变量计算、数据转发、历史数据、实时报警、规则引擎和 Web 管理。
项目组成
| 模块 | 路径 | 说明 |
|---|---|---|
| 运行时宿主 | src/ThingsGatewayRuntime |
配置加载、应用启动和进程入口 |
| 应用核心 | src/ThingsGatewayRuntime.Application |
通道、设备、变量、报警、历史数据、规则引擎和管理 API |
| 驱动基础 | src/ThingsGatewayRuntime.Foundation |
通信通道、设备抽象、数据转换和驱动基础设施 |
| 内置插件 | src/ThingsGatewayRuntime.Plugin |
可用于常规运行环境的采集与业务插件 |
| 非 AOT 插件 | src/ThingsGatewayRuntime.NOAOTPlugin |
OPC 等依赖动态能力的插件 |
| 前端资源 | src/ThingsGatewayRuntime.Frontend |
嵌入运行时的 Web 静态资源 |
| 脚本编译器 | src/ThingsGatewayScriptCompiler |
脚本和表达式编译支持 |
| 源生成器 | analyzer |
表达式和插件注册代码生成 |
| Bootstrapper | src/Bootstrapper |
.NET 10 离线环境检测、安装和应用启动 |
| Web 前端 | web |
Vue 3 网关管理界面 |
| 自动化测试 | test/ThingsGatewayRuntime.Test |
核心运行时、驱动、规则和安全测试 |
功能特性
- 通道、设备、变量的统一建模、批量配置、状态监控和在线调试。
- Modbus、Siemens S7、DL/T 645、MQTT、OPC UA/DA 等内置协议,扩展协议由插件项目提供。
- 实时数据缓存、变量读写、WebSocket 推送和网关间同步。
- 历史数据与历史报警查询、实时报警、确认和配置管理。
- 采集驱动与业务插件生命周期、动态属性和权限元数据。
- 数据转发到 MQTT、RabbitMQ、Kafka、数据库、HTTP 等目标。
- 可视化规则流、自定义节点、运行时脚本和表达式。
- 工程备份恢复、冗余管理、健康检查、日志、审计和 TAdmin 权限体系。
技术栈
| 技术 | 当前配置 | 用途 |
|---|---|---|
| .NET | net10.0 |
后端运行时和测试 |
| TouchSocket | 4.2.17 |
TCP、UDP、串口、MQTT、WebApi 和 WebSocket |
| TAdmin | 2.1.12 |
用户、角色、权限、认证和审计 |
| TUtility | 2.0.55 |
应用启动与通用基础能力 |
| TORM | 2.0.54 |
运行时数据库访问 |
| Vue | 3.5.x |
Web 管理界面 |
| TypeScript | 6.0.x |
前端类型系统 |
| Element Plus | 2.14.x |
前端组件库 |
| Vite | 8.0.x |
前端开发和构建 |
目录结构
ThingsGatewayRuntime/
|-- analyzer/
| |-- ThingsGatewayRuntime.ExpressionsGenerator/
| `-- ThingsGatewayRuntime.PluginsGenerator/
|-- src/
| |-- Bootstrapper/
| |-- ThingsGatewayRuntime/
| |-- ThingsGatewayRuntime.Application/
| |-- ThingsGatewayRuntime.Foundation/
| |-- ThingsGatewayRuntime.Frontend/
| |-- ThingsGatewayRuntime.Plugin/
| |-- ThingsGatewayRuntime.NOAOTFoundation/
| |-- ThingsGatewayRuntime.NOAOTPlugin/
| `-- ThingsGatewayScriptCompiler/
|-- test/ThingsGatewayRuntime.Test/
|-- web/
|-- Directory.Build.props
`-- README.md
开发环境
- .NET SDK 10
- Node.js 22 和 npm
- 仓库工作区构建时使用同级
TAdmin、TUtility和TORM源码;单独使用项目时改用对应 NuGet 包。
构建
从 ThingsGateway 目录构建包含 Runtime、PRO 和 Studio 的解决方案:
dotnet restore ThingsGatewayRuntime.slnx
dotnet build ThingsGatewayRuntime.slnx -c Release
只构建运行时:
dotnet build ThingsGatewayRuntime/src/ThingsGatewayRuntime/ThingsGatewayRuntime.csproj -c Release
运行测试:
dotnet test ThingsGatewayRuntime/test/ThingsGatewayRuntime.Test/ThingsGatewayRuntime.Test.csproj -c Release
前端开发
cd web
npm install
npm run dev
开发服务器默认使用 http://localhost:3100。构建生产资源:
npm run check
npm run build
npm run build 会执行类型检查、生成静态资源,并把资源复制到 ThingsGatewayRuntime.Frontend 的嵌入目录。
运行
先构建前端资源,再启动后端:
dotnet run --project src/ThingsGatewayRuntime/ThingsGatewayRuntime.csproj
默认 WebApi 端口为 6100。运行目录下的 Configuration 用于数据库、JWT、OAuth2、日志、历史查询和 WebApi 配置;默认 SQLite 连接启用 WAL 日志模式。
扩展开发
- 采集插件、业务插件和属性元数据开发参见 插件二次开发。
- 运行时脚本、表达式和自定义节点文档位于 官方文档站点源码。
- Studio 与 Watchdog 的工程开发和部署说明参见 ThingsGatewayStudio。
相关资源
- 官方文档:https://runtime.thingsgateway.cn/
- Gitee:https://gitee.com/diego2098/ThingsGateway
- GitHub:https://github.com/kimdiego2098/ThingsGateway
- QQ 群:605534569
许可证
本项目使用 Apache-2.0 协议。
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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.
-
net10.0
- Confluent.Kafka (>= 2.15.0)
- RabbitMQ.Client (>= 7.2.1)
- ThingsGatewayRuntime.Application (>= 2.1.32)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on ThingsGatewayRuntime.Plugin:
| Package | Downloads |
|---|---|
|
ThingsGatewayRuntime.Debug
Package Description |
|
|
ThingsGatewayRuntime.NOAOTPROPlugin
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.1.32 | 0 | 7/23/2026 |
| 2.1.22 | 98 | 7/14/2026 |
| 2.1.20 | 80 | 7/12/2026 |
| 2.1.19 | 94 | 7/12/2026 |
| 2.1.17 | 112 | 7/8/2026 |
| 2.1.9 | 107 | 7/8/2026 |
| 2.1.8 | 107 | 7/7/2026 |
| 2.1.6 | 101 | 7/6/2026 |
| 2.1.5 | 103 | 7/6/2026 |
| 2.1.4 | 105 | 7/4/2026 |
| 2.1.3 | 94 | 7/4/2026 |
| 2.1.2 | 100 | 7/2/2026 |
| 2.1.1 | 98 | 7/2/2026 |
| 2.0.233 | 101 | 6/26/2026 |
| 2.0.232 | 102 | 6/25/2026 |
| 2.0.231 | 108 | 6/25/2026 |
| 2.0.225 | 109 | 6/23/2026 |
| 2.0.216 | 102 | 6/22/2026 |
| 2.0.214 | 103 | 6/22/2026 |
| 2.0.213 | 101 | 6/22/2026 |
Loading failed