ZeroLevel 4.1.0
dotnet add package ZeroLevel --version 4.1.0
NuGet\Install-Package ZeroLevel -Version 4.1.0
<PackageReference Include="ZeroLevel" Version="4.1.0" />
<PackageVersion Include="ZeroLevel" Version="4.1.0" />
<PackageReference Include="ZeroLevel" />
paket add ZeroLevel --version 4.1.0
#r "nuget: ZeroLevel, 4.1.0"
#:package ZeroLevel@4.1.0
#addin nuget:?package=ZeroLevel&version=4.1.0
#tool nuget:?package=ZeroLevel&version=4.1.0
ZeroLevel
A self-contained .NET Standard 2.1 toolkit that bundles the plumbing every non-trivial .NET service ends up writing: logging, configuration, DI, fast binary serialization, a duplex TCP protocol, a file-based partitioned key-value store, semantic helpers, scheduling, encryption, reflection helpers and more — all without pulling in a heavyweight framework.
Designed as a drop-in foundation for background services, CLI tools and embedded engines. No code generation, no source generators, no reflection-heavy bootstrap — just references and go.
Installation
dotnet add package ZeroLevel
Minimum target: netstandard2.1 (compatible with .NET Core 3.0+, .NET 5+, Mono 6.4+, Xamarin).
External dependencies: System.Text.Json, YamlDotNet, System.Runtime.CompilerServices.Unsafe.
What's inside
Application basics
| Area | Highlights |
|---|---|
| Logging | Log static facade (Log.Info, Log.Error, Log.Fatal), pluggable ILogger backends, batched async log router. |
| Configuration | Configuration static facade, YAML/JSON readers, layered sets (IConfigurationSet), environment overrides. |
| Dependency Injection | Named containers, constructor injection, singleton/transient, [Resolve] / [Parameter] attributes, Injector.Default fast path. |
| Scheduling | Single-threaded fiber-based scheduler, cron-like triggers, async task queues. |
| Services | BaseZeroService + Bootstrap lifecycle for long-running processes. |
Serialization
MessageSerializer— compact binary serializer with compiled-expression codecs for ~50 primitive and nullable types, arrays, collections and dictionaries.- Explicit
IBinarySerializable/IAsyncBinarySerializablefor hand-tuned layouts. SerializeCompatible<T>/DeserializeCompatible<T>— version-tolerant round-trips between layout variants.- Lazy collection readers (
ReadCollectionLazy<T>) that stream elements as they arrive.
Networking
- Duplex TCP protocol with message / request-response / keep-alive framing.
SocketServer+SocketClientbuilt on explicit threads,FrameParserstate machine,RequestBufferfor callback correlation.- Adaptive buffer manager, chunked file transfer (
FileTransfer/). - Service discovery client (
IDiscoveryClient) and pluggable routing (IRouter/IServiceRoutesStorage).
Storage and data
- PartitionStorage — embedded key-value store partitioned by computed meta (date, tenant, hash), with merge steps, sparse indexes and compression hooks.
- DataStructures —
BloomFilter,HyperBloomBloom,BitMapCardTable,SafeBit32Vector,SparceVector,SparseMatrix.
Semantic and text
- Snowball stemmer adapter, stop-word lists, n-gram tokenizer, edit-distance metrics.
TextAnalizer.ExtractWords/ExtractRuWords(Russian-aware regex),WordTokenwith positions.- Transliteration, text-on-curve rendering, plain-text table renderer.
Utilities
- Murmur3 hashing, Rijndael encryption,
TokenEncryptor, deterministicStringHash. FSUtils(path correction, folder archiving), leak-freeFileSystemWatcherwrapper.InvokeWrapper— cached compiled delegates byname + signature.- Object mapping (
ObjectMapping), PredicateBuilder for dynamic LINQ, Specification pattern, Query pipeline. - Tries, suffix automata, priority queues, round-robin / sparse iterators,
EverythingStorage,FixSizeQueue,AtomicBoolean.
Quick start
Logging
using ZeroLevel;
Log.AddConsoleLogger(LogLevel.Info | LogLevel.Error);
Log.Info("Service {0} started", "indexer");
Configuration
var cfg = Configuration.ReadFromApplicationConfig();
var port = cfg.First<int>("port");
Dependency Injection
using ZeroLevel;
Injector.Default.Register<ILogger, ConsoleLogger>();
Injector.Default.Register<IMyService, MyService>();
var svc = Injector.Default.Resolve<IMyService>();
Binary serialization
using ZeroLevel.Services.Serialization;
public sealed class Payload : IBinarySerializable
{
public string Title;
public DateTimeOffset CreatedAt;
public void Serialize(IBinaryWriter w) { w.WriteString(Title); w.WriteDateTimeOffset(CreatedAt); }
public void Deserialize(IBinaryReader r) { Title = r.ReadString(); CreatedAt = r.ReadDateTimeOffset(); }
}
byte[] bytes = MessageSerializer.Serialize(new Payload { Title = "hi", CreatedAt = DateTimeOffset.UtcNow });
Payload back = MessageSerializer.Deserialize<Payload>(bytes);
Duplex TCP client
var exchange = UseExchange();
var client = exchange.GetConnection("127.0.0.1:3456");
client.Send("ping");
var pong = await client.Request<PingRequest, PongResponse>(new PingRequest());
Source layout
ZeroLevel/
├── DataStructures/ BloomFilter, SparseMatrix, BitMapCardTable, ...
├── Models/ BaseModel, InvokeResult, ZeroServiceInfo, DataRequest
└── Services/
├── Cache/ TimerCache and friends
├── Collections/ EverythingStorage, FixSizeQueue, RoundRobinCollection, ...
├── Config/ Configuration facade, YAML/JSON loaders
├── DOM/ DSL for templated text generation
├── DependencyInjection/ Injector facade, Container, attributes
├── Drawing/ Text-on-curve rendering
├── Encryption/ Rijndael, token encryption
├── FileSystem/ FSUtils, ParallelFileReader, archive helpers
├── Formats/ YAML ↔ JSON converter
├── HashFunctions/ Murmur3, StringHash (deterministic)
├── Invokation/ Cached compiled delegates
├── Logging/ Log facade, routers, buffered loggers
├── Mathemathics/ (sic — keep the legacy spelling)
├── Memory/ MMF view accessors
├── Network/ SocketServer / SocketClient / Exchange / FrameParser
├── ObjectMapping/ Property-level mapping
├── PartitionStorage/ File-based partitioned KV store
├── Queries/ PredicateBuilder, query pipeline
├── Reflection/ TypeHelpers, getter/setter builders
├── Semantic/ Stemmers, stop-words, n-grams, distances
├── Serialization/ MessageSerializer, PrimitiveTypeSerializer
├── Shedulling/ (sic) Fiber-based scheduler
├── Specification/ Specification pattern
├── Text/ Transliteration, plain-text tables
├── Trees/ Trie, suffix automata
└── Web/, Windows/, Utils/, Pools/, MemoryPools/, Extensions/
Notes
- Namespace
Mathemathicsis an intentional legacy spelling; renaming it would break downstream users and is explicitly avoided. netstandard2.1constrains some of the newer BCL APIs; the library stays within that surface on purpose.- Logging, Configuration, Bootstrap and Injector are exposed as static facades (e.g.
Log.Info("msg")) so that startup boilerplate is minimal; all have imperative APIs as well.
License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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 was computed. 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 was computed. 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 was computed. 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.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- System.Runtime.CompilerServices.Unsafe (>= 6.1.2)
- System.Text.Json (>= 10.0.2)
- YamlDotNet (>= 16.3.0)
NuGet packages (6)
Showing the top 5 NuGet packages that depend on ZeroLevel:
| Package | Downloads |
|---|---|
|
ZeroLevel.SqLite
Helpers for sqlite databases. Based on System.Data.SQLite.Core |
|
|
ZeroLevel.NN
Package Description |
|
|
ZeroLevel.Qdrant
Client for qdrant API |
|
|
ZeroLevel.HNSW
Package Description |
|
|
ZeroLevel.SQL
Light wrapper over ado.net |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.1.0 | 129 | 4/23/2026 |
| 4.0.0.6 | 562 | 12/18/2025 |
| 4.0.0.5 | 525 | 12/10/2025 |
| 4.0.0.4 | 493 | 12/9/2025 |
| 4.0.0.3 | 486 | 4/16/2025 |
| 4.0.0.2 | 302 | 4/10/2025 |
| 4.0.0.1 | 290 | 9/2/2024 |
| 4.0.0 | 263 | 5/1/2024 |
| 3.4.0.8 | 947 | 7/26/2023 |
| 3.4.0.7 | 280 | 7/23/2023 |
| 3.3.9.9 | 547 | 5/14/2023 |
| 3.3.9.8 | 561 | 3/12/2023 |
| 3.3.9.7 | 373 | 3/7/2023 |
| 3.3.9.6 | 492 | 2/12/2023 |
Serialization support DateTimeOffset