NewLife.Core is the foundation of the NewLife ecosystem: one package for logging, configuration, caching, networking, serialization, scheduling, object container and APM tracing. It is NativeAOT-ready, ships runtime messages in 31 languages, targets 11 frameworks from net45 to net10.0, and powers XCode, Cube, Redis, Stardust and 30+ sibling projects.
using NewLife.Caching;
using NewLife.Log;
XTrace.UseConsole(); // console log (also writes to file)
XTrace.WriteLine("Hello NewLife");
var cache = new MemoryCache(); // in-memory cache
cache.Set("key", "value", 60); // expires in 60 seconds
var value = cache.Get<String>("key"); // read back
Template scaffolding
Run the following commands in a command line to quickly experience NewLife components:
dotnet new install NewLife.Templates
dotnet new nconsole --name test
cd test
dotnet run
Platform support
Item
Coverage
Target frameworks
11 in one package: net45, net461, net462, netstandard2.0, netstandard2.1, net6.0, net6.0-windows, net8.0, net8.0-windows, net10.0, net10.0-windows
31 core scenarios measured; multi-RID CI smoke matrix (win-x64, linux-x64, linux-arm64 and linux-loongarch64 are blocking gates). Plugins and scripting are not AOT-compatible by design — see AOT Compatibility Analysis
Runtime localization
31 built-in locales; log and exception messages are localized at runtime without changing call sites (see Localization)
Legacy frameworks
net40: dotnet add package NewLife.Core --version 10.10.2024.801-net40 (net40/net45/net461); net20: --version 10.10.2024.701-net20 (net20 only). Frozen 2024-08 builds that do not track mainline updates.
Why NewLife.Core
One package for common infrastructure: logging, configuration, caching, networking, serialization, scheduling, object container and DI — a single reference is enough.
Broad coverage, modern runtime: 11 target frameworks in one package (net45 → net10.0, including Windows variants), NativeAOT-ready on the core path, and runtime messages localized into 31 languages — the same API for legacy systems and new projects.
Proven at ecosystem scale: the same foundation runs XCode (single tables of 10 billion rows), Net (1.77M pps / 14.5 Gbps, TCP 1KB), Redis and Stardust (tens of billions of records).
Restrained dependencies, permissive license: BCL and Microsoft compatibility packages only; MIT, so you can modify and rebrand (see License).
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.
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.
The solution opens in Visual Studio (latest release) and also builds with the .NET CLI; project files stay deliberately simple so that a fresh clone builds out of the box.
dotnet build NewLife.Core/NewLife.Core.csproj -c Release
dotnet test XUnitTest.Core -c Release
Full parallel run: Tools/Scripts/run-tests.ps1 (multi-host parallel, timeout guard and trx summary)
NativeAOT smoke: AotSmoke/, CI in .github/workflows/aot.yml
Source generator shipped as analyzers/ inside the package
Doc/
Capability docs and article index
Samples/
Console / service / Http / IoT / mobile samples
Benchmark/
BenchmarkDotNet performance benchmarks
XUnitTest.Core/
Main unit tests (net10.0)
XUnitTest.Compat/, XUnitTest.Net6/
Cross-version compatibility tests
AotSmoke/
NativeAOT smoke project
Release
Push a v-prefixed tag (for example v12.0.2026.1024) to trigger .github/workflows/publish.yml. The workflow packs the package, publishes it to NuGet.org and GitHub Packages, and creates a GitHub Release whose notes are taken from the matching ChangeLog.md section (assets include nupkg and snupkg). A manual run only publishes packages and does not create a Release.
Development docs
The Doc/ directory keeps a capability documentation set that mirrors the code: requirements → feature tracking → architecture. These documents are written in Chinese.
Requirements: vision, core goals and functional requirements
Feature List: implementation, test and comment status of every feature
Before submitting, make sure dotnet build and the relevant unit tests pass; follow the repository conventions for code style and commit messages.
Report bugs and suggestions via Issue; Stars and PRs are welcome.
Team
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).
This project is licensed under MIT; the strong-name certificate newlife.snk is published so you can build and replace assemblies yourself, and the sources may be modified and redistributed without attribution.
If this project is helpful to you, welcome to Star it, share it with your team, or provide improvement suggestions via Issue/PR.
NewLife.Core - Core Library
🌐 简体中文 | 繁體中文 | Español | Deutsch | 日本語 | Français | Português | Русский | 한국어 | العربية
NewLife.Core is the foundation of the NewLife ecosystem: one package for logging, configuration, caching, networking, serialization, scheduling, object container and APM tracing. It is NativeAOT-ready, ships runtime messages in 31 languages, targets 11 frameworks from net45 to net10.0, and powers XCode, Cube, Redis, Stardust and 30+ sibling projects.
Core library tutorial: https://newlifex.com/core
Contents: Quick Start · Why NewLife.Core · Main Features · Ecosystem Map · Documentation · Contributing · Team · License
Quick Start
Install
Minimal example
Template scaffolding
Run the following commands in a command line to quickly experience NewLife components:
Platform support
dotnet add package NewLife.Core --version 10.10.2024.801-net40(net40/net45/net461); net20:--version 10.10.2024.701-net20(net20 only). Frozen 2024-08 builds that do not track mainline updates.Why NewLife.Core
Main Features
Basic Extensions (10)
Logging and Tracing (2)
Scheduling (3)
Configuration System (4)
Serialization (7)
Caching (7)
High-Performance Buffers (7)
Application Framework (15)
Security and Tokens (3)
Networking (13)
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.
dotnet newproject templates for console, web, API, service, data and IoT projects.Documentation
Guides
Release notes
Contributing
Build and test
The solution opens in Visual Studio (latest release) and also builds with the .NET CLI; project files stay deliberately simple so that a fresh clone builds out of the box.
Tools/Scripts/run-tests.ps1(multi-host parallel, timeout guard and trx summary)AotSmoke/, CI in.github/workflows/aot.ymlBenchmark/(BenchmarkDotNet)Repository layout
NewLife.Core/NewLife.Core.SourceGenerator/analyzers/inside the packageDoc/Samples/Benchmark/XUnitTest.Core/XUnitTest.Compat/,XUnitTest.Net6/AotSmoke/Release
Push a
v-prefixed tag (for examplev12.0.2026.1024) to trigger.github/workflows/publish.yml. The workflow packs the package, publishes it to NuGet.org and GitHub Packages, and creates a GitHub Release whose notes are taken from the matchingChangeLog.mdsection (assets include nupkg and snupkg). A manual run only publishes packages and does not create a Release.Development docs
The
Doc/directory keeps a capability documentation set that mirrors the code: requirements → feature tracking → architecture. These documents are written in Chinese.Feedback
dotnet buildand the relevant unit tests pass; follow the repository conventions for code style and commit messages.Team
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
WeChat Official Account: 智能大石头 (scan to follow)
License
This project is licensed under MIT; the strong-name certificate
newlife.snkis published so you can build and replace assemblies yourself, and the sources may be modified and redistributed without attribution.