Meziantou.Framework
Documentation of the Meziantou.Framework libraries.
AnsiFormatting
Detect, remove and parse the ANSI escape sequences that color and style terminal output.
ASP.NET Core
Service defaults, middleware, HTTP Basic authentication, MVC tag helpers and Blazor components for ASP.NET Core applications.
Assertions
An Assert class for .NET tests with precise failure messages, and analyzers that steer you to the right assertion.
AtlassianDataFormat
Read, build and write Atlassian Document Format documents from Jira, Confluence and Bitbucket, and convert them to Markdown.
Avatar
Generate deterministic SVG avatars with initials from a name.
Barcodes
Generate QR codes and linear barcodes, and render them as SVG, PNG, text or images.
Bencode
Parse and write bencode data, and read, create and hash BitTorrent metainfo files.
BloomFilters
In-memory Bloom filters and counting Bloom filters, safe to update from several threads.
ByteSize
Create, format, parse and compare sizes in bytes, with decimal (kB, MB) and binary (kiB, MiB) units.
Charts
Create bar, line, area, scatter, pie, radar, gauge, treemap, sunburst, histogram, box plot and other charts as SVG or images, with a grammar of graphics.
ChromiumTracing
Write trace files in the Chromium trace event format, and view them on a timeline in a trace viewer.
CodeDom
Generate C# source code from a strongly-typed object model of namespaces, types, members, statements and expressions.
CodeOwners
Parse the CODEOWNERS files of GitHub and GitLab repositories into patterns, owners and sections.
CommandLine
Read the arguments of a command-line application, quote arguments for Windows programs and cmd.exe, and ask yes/no questions in the console.
Csv
Read and write CSV and TSV data from any TextReader or TextWriter, with headers, custom separators and quoted values.
DependencyScanning
Find the dependencies declared in a repository, across package ecosystems, and update their versions in place.
Diagnostics
Capture a snapshot of the execution context of a process, and write a memory dump of the current process.
DiffEngine
Find the diff tools installed on the machine and build the command line that compares two files.
DNS
Query DNS servers over UDP, TCP, TLS, HTTPS and QUIC, serve your own records, filter domains with block lists, and run a filtering DNS proxy.
EmbeddedConstantsGenerator
Embed text and binary files in your assembly as C# constants generated at build time.
FastEnumGenerator
Generate reflection-free ToString, parsing and lookup methods for the enums you choose.
FixedStringBuilder
Build short strings in fixed-capacity value types, without allocating, and generate types of any capacity.
Fonts
Read OpenType fonts, shape text into positioned glyphs, find installed fonts, subset fonts and read AFM metrics, for your own text renderer.
Meziantou.Framework (core)
Everyday helpers for .NET applications, for strings, collections, files, processes, timing, reflection and more.
FullPath
An absolute, normalized path type for .NET, with an analyzer that finds the string paths to convert.
Geo
Read and write maps in GeoJSON, TopoJSON, Shapefile, KML, GPX, WKT, WKB and FlatGeobuf, work with features and geometries, and project positions onto a plane.
Geo.Maps
Load offline map bundles, the borders, subdivisions, cities, rivers, lakes, coastline, land, ocean, seas and physical regions of a region, published as NuGet packages or built with the tool of the repository.
Globbing
Match paths against glob patterns and enumerate the files that match, in the syntax of your choice or the one of git, MSBuild or fnmatch.
Hashing
Fully managed password hashing (BCrypt, Argon2), SHA-3 and related functions, BLAKE2b, CRC-32 and Adler-32.
HtmlSanitizer
Remove the dangerous parts of untrusted HTML fragments before you show them in your pages.
HTML to Markdown
Convert HTML fragments to Markdown, from .NET code or from the command line.
HTML tool
A command-line tool that replaces values in HTML files, appends versions to their URLs and inlines their resources.
Http
Add HTTP caching, HSTS, SSRF protection and record-and-replay to HttpClient, and parse Link headers and htpasswd files.
HttpArchive
Read and write HAR 1.2 files, and turn their entries into HttpClient requests and responses.
HttpClientMock
Mock the HTTP services an HttpClient calls with an in-memory ASP.NET Core server, for tests.
HumanReadableSerializer
Write any object as readable, indented, culture-invariant text, for snapshots, logs and diffs.
Iconify
Use the icons of Iconify icon sets as strongly-typed properties generated at build time, or load icon sets at run time.
Imaging
A fully managed .NET library to read, write, process and draw images, with no native dependency.
Inline snapshot testing
Validate objects against snapshots written in the source code of your tests, and let the library update them.
JavaScript engine
An ECMAScript engine written in .NET, to run JavaScript and ES modules inside your application.
JSONPath
Query System.Text.Json documents and custom object models with standard JSONPath (RFC 9535).
LLMContext
Detect whether the application runs inside an AI coding agent or an LLM tool, from its environment variables.
Language
Parse CSS, INI, JSON, TOML, XML, regular expressions and shell scripts into syntax trees that keep every character, report diagnostics, and edit text without reformatting it.
Logging
ILogger providers that write to files, keep the entries in memory for tests, or write to the xUnit.net test output.
Markdown
A CommonMark compliant, extensible Markdown processor for .NET, with a syntax tree, HTML rendering and roundtrip.
MediaTags
Read and write the metadata tags of MP3, OGG, FLAC, MP4, WAV and AIFF audio files.
Node.js
Run JavaScript code and call Node.js modules, local files or npm packages, from .NET.
NTP
Read the time of an NTP server and the offset of the local clock, or serve the time of the machine over NTP.
NuGetPackageValidation
Check that NuGet packages have the metadata, symbols and documentation users expect, from code or from the command line.
ObjectMethodExecutor
Invoke synchronous and asynchronous methods from their MethodInfo, and await any awaitable result.
OpenTelemetryCollector
Receive OTLP logs, traces and metrics in an ASP.NET Core application, handle them in code, or keep them in memory for tests.
Package dependencies
See which Meziantou.Framework packages you also get when you install one.
PDF
A fully managed .NET library to create, read, modify, render and sign PDF documents.
PooledMemoryStream
A MemoryStream backed by pooled byte arrays that also implements IBufferWriter<byte>.
ProcessWrapper
Run processes with a fluent API, stream or capture their output, pipe them together, limit their resources and replace them in tests.
Public API generator
Write the public API of a .NET assembly as C# files, keep them up to date in the build, and review API changes in pull requests.
RelativeDate
Write a date as a localized relative text, such as "5 minutes ago" or "in 3 days".
ResxSourceGenerator
Generate strongly-typed accessors for .resx files, with format methods for the strings that have placeholders.
RobotsTxt
Parse robots.txt files and check which paths a crawler may fetch.
Roslyn
Source helpers for Roslyn analyzers and source generators, compiled into your project.
Scheduling
Compute the occurrences of recurrence rules (RFC 5545) and cron expressions, across time zones, and read and write iCalendar events.
SensitiveData
Keep secrets such as passwords and keys in a type that is hard to disclose by accident.
SimpleQueryLanguage
Turn search-box queries such as "author:alice AND comments>=2" into filters for in-memory objects or Entity Framework Core queries.
SingleInstance
Make sure an application runs only once per user, and pass the arguments of the next launches to the running instance.
Slug
Turn a title into a URL-friendly slug, such as "creme-brulee-recipe".
Snapshot testing
Validate objects, documents, images and generated code against snapshot files stored next to your tests.
StronglyTypedId
Generate strongly-typed IDs that wrap an int, a Guid or a string, with parsing, formatting and converters for serializers and frameworks.
Syntax highlighting
Highlight source code in more than a hundred languages as HTML with CSS classes.
Tagged values
Tag ids, units and keys with an attribute, and let a Roslyn analyzer report the values that get mixed up.
TdsServer
A server that speaks the TDS protocol of SQL Server, so SQL Server clients can query your .NET code.
Templating
Generate text, source code and HTML emails from templates whose code blocks are C#.
TemporaryContainers
Start throwaway containers from .NET integration tests, with the Docker Engine API, Docker, Podman, Apple container or wslc.
TemporaryDirectory
Create a unique temporary folder or file that is deleted when you dispose it.
TextDiff
Compute the differences between two texts, line by line, word by word or character by character.
Threading
Asynchronous locks, signals, thread-safe collections and task helpers for concurrent .NET code.
TOML
Read and write TOML 1.1 in .NET, as typed objects, as a document model or as a lossless syntax tree.
TypeConverter
Convert values between types, such as strings to numbers, enums, GUIDs or byte arrays, with a culture.
UndoRedo
Add undo and redo to an application, with asynchronous actions, transactions and merged steps.
Unicode
Unicode text algorithms and data that give the same results on every platform: properties, segmentation, line breaking, normalization, bidirectional text, domain names and spoofing detection.
Unix control groups
Create Linux control groups (cgroups v2), limit the CPU, memory, IO and processes of a group of processes, and read their usage.
Uri
Match URLs against URL patterns, read and edit query strings, and find the registrable domain of a host name.
ValueStopwatch
Measure elapsed time with a struct that wraps the high-resolution timestamps of Stopwatch.
ValueStringBuilder
Build strings in a stack buffer or a pooled array with a ref struct string builder.
Versioning
Parse, compare and increment Semantic Versioning 2.0.0 versions, and check them against NuGet or npm ranges.
WPF
Commands, enum markup extensions, a boolean converter, dispatcher and window helpers for WPF applications.
WebPlatform
A browser engine for .NET: parse HTML and CSS as a browser does, query and change the DOM, load pages, run their scripts, take screenshots and print to PDF.
Win32
Use Windows features from .NET - access tokens, antimalware scans, the change journal, credentials, job objects, virtual file systems and more.
Xunit
Run or skip xUnit.v3 tests depending on the operating system, the globalization mode, the CI server or the Windows user.
YAML
Read, write and serialize YAML 1.2 documents in .NET, with a source generator for NativeAOT and trimming.