ZeroDocuments.Core 1.1.0

dotnet add package ZeroDocuments.Core --version 1.1.0
                    
NuGet\Install-Package ZeroDocuments.Core -Version 1.1.0
                    
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="ZeroDocuments.Core" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ZeroDocuments.Core" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="ZeroDocuments.Core" />
                    
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 ZeroDocuments.Core --version 1.1.0
                    
#r "nuget: ZeroDocuments.Core, 1.1.0"
                    
#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 ZeroDocuments.Core@1.1.0
                    
#: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=ZeroDocuments.Core&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=ZeroDocuments.Core&version=1.1.0
                    
Install as a Cake Tool

ZeroDocuments

NuGet Version License: MIT Zero External Dependencies Tests: 27 Passed Multi-Targeting

Architectural Standard: 100% Pure C# BCL, Zero External Dependencies (No EPPlus, ClosedXML, or DevExpress), Multi-Targeting across .NET 8.0, .NET Framework 4.6.2, and .NET Standard 2.0.

ZeroDocuments is an ultra-fast, zero-dependency spreadsheet and document processing engine engineered for enterprise applications (MDS ERP, WinForms, Web APIs, and microservices). It reads and writes modern Microsoft Excel files (.xlsx) and RFC 4180 CSV streams in pure C# using native BCL primitives (System.IO.Compression + System.Xml), eliminating the need for bulky third-party libraries (EPPlus, ClosedXML, NPOI) or expensive proprietary packages (DevExpress).


๐Ÿ’ก Why ZeroDocuments?

Feature Legacy Libraries (EPPlus, ClosedXML) DevExpress Spreadsheet ZeroDocuments
Dependencies 5 โ€“ 15 transitive packages Heavy proprietary DLLs (~40MB+) 0 External Dependencies (BCL only)
License Commercial / PolyForm / AGPL Commercial (Per-Developer License) MIT License (Free & Open Source)
Publish Size +15MB โ€“ 30MB +40MB โ€“ 80MB < 100 KB
Memory Footprint Heavy DOM Tree (>200MB on 100k rows) Heavy UI/DOM model Streaming XmlReader (< 15MB RAM)
Security Vulnerable to CSV Injection if unescaped Depends on implementation CWE-1236 Formula Guard Built-in
.NET 4.6.2 Compatibility Prone to System.IO.Compression binding issues Complex assembly deployment Native Auto-Resolver built-in

๐Ÿ›๏ธ Comprehensive Architecture

ZeroDocuments.Core
 โ”œโ”€โ”€ Excel/
 โ”‚    โ”œโ”€โ”€ ZeroExcel.cs                   # Fluent multi-sheet workbook factory
 โ”‚    โ”œโ”€โ”€ ExcelWorkbookBuilder.cs        # Multi-sheet OpenXML package generator with styling
 โ”‚    โ”œโ”€โ”€ ExcelReader.cs                 # Low-memory streaming XmlReader & POCO mapper
 โ”‚    โ”œโ”€โ”€ ExcelWriter.cs                 # High-speed single-sheet OpenXML exporter
 โ”‚    โ””โ”€โ”€ Models/
 โ”‚         โ”œโ”€โ”€ ExcelCellAddress.cs       # Coordinate calculations (e.g., "D24" -> Col 4, Row 24)
 โ”‚         โ”œโ”€โ”€ ExcelRow.cs               # Column-indexed lightweight row model
 โ”‚         โ””โ”€โ”€ ExcelCell.cs              # Typed cell value container
 โ”œโ”€โ”€ Csv/
 โ”‚    โ”œโ”€โ”€ CsvReader.cs                   # RFC 4180 streaming CSV parser with delimiter flexibility
 โ”‚    โ””โ”€โ”€ CsvWriter.cs                   # Fast DataTable & typed collection CSV generator with CWE-1236 guard
 โ””โ”€โ”€ Common/
      โ”œโ”€โ”€ PropertyAccessorCache.cs       # Compiled Expression Trees for 30x-50x faster POCO mapping
      โ””โ”€โ”€ RuntimeAssemblyResolver.cs     # Self-healing assembly binder for .NET Framework runtimes

๐ŸŒŸ Key Capabilities

1. Low-Memory Streaming Excel Reader (ExcelReader)

  • Forward-Only Streaming (StreamRows): Processes 1,000,000+ rows with < 15MB RAM without building heavy DOM trees.
  • Compiled POCO Mapping (Read<T>): Maps worksheets directly into strongly-typed DTOs via compiled Expression Trees without reflection lag.
  • Header-Bounded Range Parsing: Read data bounded by a specific header range (e.g. D24:T24), ideal for complex enterprise invoice and production templates.

2. Fluent Multi-Sheet Workbook Builder (ZeroExcel)

  • Multi-Sheet Support: Add multiple sheets with custom names, data sources (DataTables, POCOs, 2D grids), and header styling (Bold, border layout).
  • Formula Injection Mitigation (CWE-1236): Automatically neutralizes malicious formula payloads (=, +, -, @) to protect downstream users.
  • Direct Memory & File Export: Save to file, stream, or byte array (ToArray()).

3. Compiled Expression Trees (PropertyAccessorCache)

  • Eliminates reflection overhead when serializing or deserializing collections of objects, achieving 30xโ€“50x speedups over PropertyInfo.GetValue.

4. RFC 4180 CSV Engine (CsvReader & CsvWriter)

  • Flexible Delimiters: Support for comma (,), semicolon (;), tab (\t), and custom delimiters.
  • CWE-1236 Guard: Prevents CSV injection attacks by automatically prefixing dangerous trigger characters with single quotes.

5. Self-Healing Runtime Assembly Resolver (RuntimeAssemblyResolver)

  • Automatically resolves .NET Framework 4.6.2 assembly binding redirects for System.IO.Compression.

๐Ÿš€ Quick Start Examples

1. Read Excel by Header Range (Enterprise Template Pattern)

using ZeroDocuments.Excel;

// Read starting from header D24:T24 down to a maximum of 5,000 rows
DataTable table = ExcelReader.ReadByHeaderRange("PurchaseOrder.xlsx", "D24:T24", maxRows: 5000);

foreach (DataRow row in table.Rows)
{
    string itemCode = row["Item Code"]?.ToString() ?? "";
    decimal quantity = Convert.ToDecimal(row["Quantity"]);
    Console.WriteLine($"Item: {itemCode} | Qty: {quantity}");
}

2. Stream Rows from Excel File

using ZeroDocuments.Excel;

// Stream rows without loading the entire document into memory
var rows = ExcelReader.ReadRows("Inventory.xlsx", "A1:Z500");

foreach (var row in rows)
{
    string? barcode = row["B"]; // Read cell by column letter
    string? name = row["C"];
    Console.WriteLine($"{barcode}: {name}");
}

3. Multi-Sheet Workbook Builder (ZeroExcel)

using ZeroDocuments.Excel;

using var workbook = ZeroExcel.Create();
workbook.AddSheet("Summary", summaryTable);
workbook.AddSheet("Products", productList);
workbook.AddSheet("AuditLogs", logRows, headers: new[] { "Event", "Date", "Status" });

// Save directly to file or byte array
workbook.Save("EnterpriseReport.xlsx");
byte[] rawBytes = workbook.ToArray();

4. Read Excel to Strongly-Typed POCO Collections

using ZeroDocuments.Excel;

// Automatically map Excel columns into ProductDto properties via compiled Expression Trees
List<ProductDto> products = ExcelReader.Read<ProductDto>("Products.xlsx", "A1:E500", "ProductCatalog");

foreach (var p in products)
{
    Console.WriteLine($"ID: {p.Id}, SKU: {p.Sku}, Price: {p.Price:C}");
}

5. Read and Write CSV Files with CWE-1236 Protection

using ZeroDocuments.Csv;

// Read CSV to DataTable
DataTable csvData = CsvReader.ReadToDataTable("telemetry.csv", delimiter: ',');

// Write DataTable to CSV (with automatic formula injection mitigation)
CsvWriter.WriteToFile("output.csv", csvData, delimiter: ';', includeHeaders: true);

๐Ÿ’ป Supported Platforms

Framework Target Support Highlights
.NET 8.0+ Native (net8.0) High-throughput ZIP and memory optimization
.NET Framework Legacy WinForms / WPF (net462) Includes automatic assembly resolver for compression
.NET Standard Universal Cross-Platform (netstandard2.0) Universal compatibility for shared libraries

๐Ÿ“„ License

MIT License ยฉ 2026 Phong Vรต (kzxl). Part of the ZeroPlatform sovereign ecosystem.

Product 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 is compatible.  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 netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.1.0 0 9/20/2026
1.0.0 49 9/17/2026