Expat.Net
2.7.3-beta-1
See the version list below for details.
dotnet add package Expat.Net --version 2.7.3-beta-1
NuGet\Install-Package Expat.Net -Version 2.7.3-beta-1
<PackageReference Include="Expat.Net" Version="2.7.3-beta-1" />
<PackageVersion Include="Expat.Net" Version="2.7.3-beta-1" />
<PackageReference Include="Expat.Net" />
paket add Expat.Net --version 2.7.3-beta-1
#r "nuget: Expat.Net, 2.7.3-beta-1"
#:package Expat.Net@2.7.3-beta-1
#addin nuget:?package=Expat.Net&version=2.7.3-beta-1&prerelease
#tool nuget:?package=Expat.Net&version=2.7.3-beta-1&prerelease
Expat.Net
This unofficial bindings provides a managed wrapper built on top of libexpat, using P/Invoke internally but not exposing the native API directly.
Instead, it offers a focused, idiomatic C# surface centered around a single class, XmlParser, which owns and manages the native Expat parser instance, its lifetime, and its callbacks.
The goal is to combine Expat’s performance and streaming model with a controlled, predictable .NET API suitable for high-throughput and long-running parsers.
Design Overview
- Native Expat functions are accessed internally via P/Invoke
- Consumers interact only with the managed
XmlParserclass - The native parser instance is created, configured, and destroyed by
XmlParser - Callbacks are marshaled into managed code in a controlled manner
XmlParser API Model
XmlParser exposes a SAX-like callback model:
OnStartElementOnEndElementOnTextOnCdataOnComment
Dependencies
- Native libexpat (build with vcpkg or grab in libexpat github releases page)
- .NET (C#)
Version Alignment
There is an explicit intention to keep this project aligned with the latest official libexpat releases.
Notes
The native library must be available on the system (.dll, .so, or .dylib depending on the platform).
This library implement native library resolver to attempt load almost all possible combinations of native library name (libexpat, expat, expat.so.1, etc...).
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.7.3-beta-2 | 57 | 1/19/2026 |
| 2.7.3-beta-1 | 249 | 12/17/2025 |