.NEXT 5.x

.NEXT (dotNext) is the family of powerful libraries aimed to improve development productivity and extend the .NET API with unique features. The project is supported by the.NET Foundation.

Note

The documentation for previous major versions is no longer available on this website. However, API docs are still available onFuGet website for any specific library version. Migration guides arehere.

This chapter gives a quick overview of these libraries. Readarticles for a closer look at all available features.

Prerequisites:

  • Runtime: .NET 8
  • OS: Linux, Windows, MacOS, WASM, WASI
  • Architecture: any if supported by the underlying .NET Runtime

DotNext

Downloads
This library is the core of .NEXT which extends .NET standard library with

  • Generic ranges
  • Unified representation of various synchronization primitives in the form of the lock
  • Generation of random strings
  • Ad-hoc user data associated with arbitrary object
  • A rich set of dynamic buffer types
  • Fast HEX conversion
  • Fast Base64encoding/decoding for streaming scenarios
  • Optional andResult monads
  • Soft Reference andasync GC notifications
  • LEB128 encoding support

DotNext.Metaprogramming

Downloads
This library provides a rich API to write and execute code on-the-fly. It extendsC# Expression Tree programming model with ordinary things for C# such asforeach loop,for loop,while loop,using statement,lock statement, string interpolation and even asynchronous lambda expressions with full support ofasync/await semantics.

DotNext.Unsafe

Downloads
This library provides a special types to work with unmanaged memory in safe manner:

  • Structured access to unmanaged memory
  • Unmanagedmemory pool
  • Interop with unmanaged memory viaMemory value type
  • CLS-compliant generic pointer type for .NET languages without direct support of such type. Use this feature to work with pointers from VB.NET or F#.
  • Atomic thread-safe operations applicable to data placed into unmanaged memory: increment, decrement, compare-and-set etc, volatile access

DotNext.Threading

Downloads
The library allows you to reuse experience of blocking synchronization with help ofReaderWriteLockSlim,CountdownEvent and friends in asynchronous code using their alternatives such as asynchronous locks.

The following code describes these alternative implementations of synchronization primitives for asynchronous code:

Synchronization PrimitiveAsynchronous Version
ReaderWriteLockSlimAsyncReaderWriterLock
MonitorAsyncExclusiveLock
ManualResetEventAsyncManualResetEvent
AutoResetEventAsyncAutoResetEvent
BarrierAsyncBarrier
CountdownEventAsyncCountdownEvent

Some of the asynchronous counterparts have synchronous methods for waiting and lock acquisition that can help to convert step-by-step synchronous code to asynchronous.

But this is not all features of this library. Read morehere.

DotNext.IO

Downloads
Extending streams and I/O pipelines with methods for reading and writing typed values including strings asynchronously. Arbitrary character encodings are supported. Now encoding or decoding data usingpipes is much easier and comparable withBinaryWriter orBinaryReader. Read morehere.

DotNext.Net.Cluster

Downloads
Provides rich framework for buildingclustered microservices based on network consensus and Gossip-based messaging. It includes transport-agnostic implementation ofRaft Consensus Algorithm that can be adopted for any communication protocol, TCP/UDP transports for Raft, high-performance persistent Write-Ahead Log suitable for general-purpose usage. Transport-agnostic implementation ofHyParView membership protocol included as well.

DotNext.AspNetCore.Cluster

Downloads
Allows to build clustered microservices which rely on network consensus and distributed messaging withASP.NET Core framework. This library contains HTTP-based implementation ofRaft Consensus Algorithm, HTTP-based distributed messaging across cluster nodes, cluster leader detection, automatic redirection to leader node, HTTP binding for HyParView.

DotNext.MaintenanceServices

Downloads
ProvidesApplication Maintenance Interface (AMI) for .NET apps and microservices that allows to send maintenance commands to the application directly using Unix Domain Sockets and Unix utilities such asnetcat. Thus, the interface is fully interoperable with command-line shells such as Bash. Additionally, AMI enables support ofKubernetes probes for .NET apps in a unified way. Readthis article for more information.