ZeroDocuments.Core
1.1.0
dotnet add package ZeroDocuments.Core --version 1.1.0
NuGet\Install-Package ZeroDocuments.Core -Version 1.1.0
<PackageReference Include="ZeroDocuments.Core" Version="1.1.0" />
<PackageVersion Include="ZeroDocuments.Core" Version="1.1.0" />
<PackageReference Include="ZeroDocuments.Core" />
paket add ZeroDocuments.Core --version 1.1.0
#r "nuget: ZeroDocuments.Core, 1.1.0"
#:package ZeroDocuments.Core@1.1.0
#addin nuget:?package=ZeroDocuments.Core&version=1.1.0
#tool nuget:?package=ZeroDocuments.Core&version=1.1.0
ZeroDocuments
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.2assembly binding redirects forSystem.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 | Versions 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. |
-
.NETFramework 4.6.2
- System.Buffers (>= 4.5.1)
- System.Memory (>= 4.5.5)
-
.NETStandard 2.0
- System.Buffers (>= 4.5.1)
- System.IO.Compression (>= 4.3.0)
- System.Memory (>= 4.5.5)
-
net8.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.