NewLife.Extensions.Hosting.AgentService 10.18.2026.1024

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

NewLife.Agent - Cross-Platform Service Daemon & Ops Framework

GitHub top language

GitHub License NuGet Downloads NuGet NuGet prerelease test locales platform arch contributors

🌐 简体中文 | 繁體中文 | Español | Deutsch | 日本語 | Français | Português | Русский | 한국어 | العربية

Tutorial: https://newlifex.com/core/agent


Overview

NewLife.Agent is a service-oriented framework for long-running applications. It enables console/Web/Worker programs to be quickly hosted as operating system services, and provides unified install, start/stop, monitoring, restart, and troubleshooting capabilities.

Supported platforms:

  • Windows (Service / startup at login)
  • Linux (Systemd / Procd / RcInit, etc.)
  • macOS (LaunchAgent)

Supported frameworks:

  • NewLife.Agent: net40;net45;net461;netstandard2.0;netstandard2.1;net6.0;net7.0;net8.0;net9.0;net10.0
  • NewLife.Extensions.Hosting.AgentService: netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net9.0;net10.0

Highlights

  • Integrated Development and Operations: Inherit ServiceBase to gain full service governance capabilities.
  • Built-in Web Dashboard: A lightweight management panel for viewing status and performing operations in a browser, with extension panels and theme switching, built-in token authentication and brute-force protection; it listens on localhost by default (WebBind can expose it to the LAN).
  • 31-Language Localization: Built-in commands, configuration descriptions, Hosting messages and the Web dashboard support 31 languages with language switching and RTL; request culture is resolved automatically by NewLife.Core.
  • Cross-Platform Auto-Adaptation: Automatically selects the most suitable host implementation per operating system.
  • NativeAOT Native Publishing Support: Built-in commands and the Web dashboard are fully adapted for trimming/AOT; net8.0+ builds produce zero IsAotCompatible warnings, and CI covers 12 RIDs: 9 targets run real smoke tests (8 native targets + linux-loongarch64 under QEMU user-mode emulation), while cross targets (linux-arm/linux-musl-arm/linux-musl-arm64) get publish verification.
  • Multi-Architecture Unit Tests: win-x64 / linux-x64 / linux-arm64 run natively, and linux-loongarch64 (Loongson) runs the full test suite under QEMU user-mode emulation; triggered by push/PR and supports manual runs.
  • Built-in Command System: Supports -install/-start/-stop/-restart/-status/-run.
  • Health Monitoring & Self-Healing: The HealthMonitor component provides memory/thread/handle thresholds, scheduled restarts, and WatchDog health checks.
  • Multi-Instance Friendly: Configure different ServiceName values to deploy multiple instances of one program.
  • Host Integration Extension Package: Bring ASP.NET Core/Worker applications under unified service lifecycle management.

Getting Started

1) Minimal Service

Inherit ServiceBase and call Main(args) at the entry point:

  • Override StartWork(String reason) to start your business logic
  • Override StopWork(String reason) to stop and clean up resources

2) Command-Line Operations

Common commands:

  • -i: Install the service
  • -install: Install and start the service
  • -start: Start the service
  • -stop: Stop the service
  • -restart: Restart the service
  • -status: View service status
  • -u: Uninstall the service
  • -uninstall: Stop and uninstall the service
  • -run: Run in console mode (for debugging)

Install/uninstall/start/stop typically require Administrator (Windows) or root (Linux) privileges.

3) ASP.NET Core / Worker Integration

Reference NewLife.Extensions.Hosting.AgentService and call UseAgentService() on your HostBuilder to bridge the generic host lifecycle with Agent service governance.


Documentation


Quick Install

dotnet new install NewLife.Templates
dotnet new service --name agent
cd agent
dotnet run

Ecosystem Map

NewLife is a layered ecosystem of independently versioned open-source projects. The map below is shared verbatim by every NewLife repository; each project links to its repository and its primary NuGet package.

Project What it does Downloads
Foundation
NewLife.Core Logging, configuration, caching, networking, serialization, scheduling and APM tracing. NuGet
NewLife.XCode Data middleware: single tables at the tens-of-billions scale, automatic sharding, read-write splitting, 10+ databases. NuGet
NewLife.Net High-performance network library: 1.77M pps / 14.5 Gbps on a single machine (TCP 1KB, 2026-10), 4M long-lived TCP connections. NuGet
NewLife.Remoting Protocol communication and RPC framework for client/server applications and IoT devices. NuGet
NewLife.Agent Installs .NET applications as OS daemons: Windows services and Linux systemd. NuGet
NewLife.Templates dotnet new project templates for console, web, API, service, data and IoT projects. NuGet
Data & Messaging
NewLife.Redis Redis client with microsecond latency, millions of ops/s and built-in message queues. NuGet
NewLife.RocketMQ Pure managed RocketMQ client for Apache RocketMQ and Alibaba Cloud Message Queue. NuGet
NewLife.MQTT MQTT client and server, including Alibaba Cloud IoT connectivity. NuGet
NewLife.NovaDb Hybrid database in C#: embedded or networked, relational, time-series, message queue and KV in one. NuGet
NewLife.MySql MySql driver and helper layer built on the NewLife data stack. NuGet
Web, AI & Distributed
NewLife.Cube Rapid admin-platform framework: permissions, SSO, OAuth server and CRUD scaffolding. NuGet
Stardust Distributed service platform: node management, APM, configuration center, registry and release center. NuGet
AntJob Distributed task and real-time data scheduling platform with sharding, retries and backfill. NuGet
NewLife.AI Unified client for 46 LLM providers plus ChatAI, a ready-to-run web chat application. NuGet
Industrial & IoT
NewLife.IoT IoT standard library defining protocol contracts and device abstractions. NuGet
NewLife.Modbus Modbus TCP/RTU/ASCII implementation on top of NewLife.IoT. NuGet
NewLife.Siemens Siemens PLC protocol on top of NewLife.IoT. NuGet
NewLife.Omron Omron PLC protocol on top of NewLife.IoT. NuGet
NewLife.Melsec Mitsubishi Melsec PLC protocol on top of NewLife.IoT. NuGet
NewLife.OPC OPC client for industrial data access. —
NewLife.BACnet BACnet building-automation protocol stack. NuGet
ZeroIoT Lightweight open-source IoT platform with gateway and device management. —
Vehicle Telematics
NewLife.JT808 JT/T 808 vehicle positioning protocol: 70+ message bodies, 2011/2013/2019. NuGet
NewLife.JT809 JT/T 809 platform-to-platform protocol for transport authorities. NuGet
NewLife.JT1078 JT/T 1078 in-vehicle video: RTP parsing, FLV/fMP4 remuxing and live streaming. NuGet
Domain Components
NewLife.Office One package for Excel, Word, PPT, PDF and 15+ document formats. NuGet
NewLife.Audio Cross-platform audio: codecs, device I/O, DSP, containers and streaming. NuGet
NewLife.Video Video codecs, container formats, frame processing and streaming. NuGet
NewLife.Map Unified interface over Baidu, AMap, Tencent and Tianditu with geocoding and coordinate conversion. NuGet
NewLife.IP IPv4 geolocation with an offline memory-mapped database and an online API fallback. NuGet
Tools & Products
CrazyCoder Developer toolbox: network, serial port, crypto, regex, Modbus and MQTT. NuGet
GitCandy Self-hosted Git source code management system. —
LuckyClover Installs the matching .NET runtime automatically when launched from an older host. —

Badges show the primary package of each project; theme, extension and satellite packages are listed on their NuGet pages.The 30+ packages not listed here (FTP, LoRa, Office extensions, protocol drivers and more) are available under the NewLifeX organization and on newlifex.com.


Team

<img src="https://newlifex.com/logo.png" width="48" align="right" alt="NewLife" />

Founded in 2002, the NewLife team has spent more than two decades on the .NET and IoT ecosystem, maintains nearly 100 open-source projects (34 of them core to this map), and delivers integrated software and hardware solutions for power, logistics, healthcare, industrial control and internet industries. We live by the motto "learning has no seniority — mastery earns respect".

Open-source components have been downloaded 6.48M times from NuGet (ecosystem-wide, as of 2026-10).

Website: https://newlifex.com · Open source organization: https://github.com/NewLifeX

<details> <summary>WeChat Official Account: 智能大石头 (scan to follow)</summary>

智能大石头

</details>

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

NuGet packages (1)

Showing the top 1 NuGet packages that depend on NewLife.Extensions.Hosting.AgentService:

Package Downloads
sljc_WebApi.Core

用于后台API服务包

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.18.2026.1024 53 10/24/2026
10.18.2026.1024-beta0307 44 10/24/2026
10.18.2026.1024-beta0259 55 10/24/2026
10.18.2026.1013-beta0145 79 10/13/2026
10.18.2026.1013-beta0140 79 10/13/2026
10.17.2026.1021-beta0235 81 10/21/2026
10.17.2026.1020-beta1532 83 10/20/2026
10.17.2026.1019-beta1541 80 10/19/2026
10.17.2026.1019-beta0429 84 10/19/2026
10.17.2026.1018-beta1720 80 10/18/2026
10.17.2026.1016-beta0349 103 10/16/2026
10.17.2026.1016-beta0209 93 10/16/2026
10.17.2026.1013-beta0316 80 10/13/2026
10.17.2026.1013-beta0223 77 10/13/2026
10.17.2026.1013-beta0210 82 10/13/2026
10.17.2026.1013-beta0136 74 10/13/2026
10.17.2026.801 331 8/1/2026
10.17.2026.801-beta1644 128 8/1/2026
10.16.2026.716-beta1245 125 7/16/2026
10.16.2026.716-beta0610 124 7/16/2026
Loading failed

新增 31 种语言本地化,内建命令/配置描述/Hosting 消息/Web 面板全面多语言化并支持 RTL;Web 面板新增 WebBind 绑定配置与语言切换;NativeAOT 全面适配并覆盖 12 个 RID 发布冒烟;新增多架构单元测试矩阵与 riscv64/s390x 指令集冒烟;修复 SysVinit 路径查询与 UseAgentService 无参调用问题;升级 NewLife.Core 至 12.0.2026.1024