Expat.Net 2.7.3-beta-1

This is a prerelease version of Expat.Net.
There is a newer prerelease version of this package available.
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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Expat.Net" Version="2.7.3-beta-1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Expat.Net" Version="2.7.3-beta-1" />
                    
Directory.Packages.props
<PackageReference Include="Expat.Net" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Expat.Net --version 2.7.3-beta-1
                    
#r "nuget: Expat.Net, 2.7.3-beta-1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Expat.Net@2.7.3-beta-1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Expat.Net&version=2.7.3-beta-1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Expat.Net&version=2.7.3-beta-1&prerelease
                    
Install as a Cake Tool

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 XmlParser class
  • 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:

  • OnStartElement
  • OnEndElement
  • OnText
  • OnCdata
  • OnComment

Dependencies

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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