Soenneker.Excel.Util 11.0.376

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

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Excel.Util

Maps rows in an .xlsx worksheet to strongly typed objects and writes object lists to a new workbook using ClosedXML.

Install

dotnet add package Soenneker.Excel.Util

Define a row type

using Soenneker.Excel.Util.Attributes;

public sealed class Person
{
    public string Name { get; set; } = "";
    public int Age { get; set; }

    [ExcelColumn("Email Address")]
    public string Email { get; set; } = "";
}

Public instance properties must have public getters and setters and cannot be indexers. By default the header must exactly match the property name. ExcelColumnAttribute supplies a different exact header.

Register and use

using Microsoft.Extensions.DependencyInjection;
using Soenneker.Excel.Util.Abstract;
using Soenneker.Excel.Util.Registrars;

var services = new ServiceCollection();
services.AddLogging();
services.AddExcelUtilAsSingleton();

using ServiceProvider provider = services.BuildServiceProvider();
IExcelUtil excel = provider.GetRequiredService<IExcelUtil>();

var people = new List<Person>
{
    new() { Name = "Alice", Age = 30, Email = "alice@example.com" },
    new() { Name = "Bob", Age = 25, Email = "bob@example.com" }
};

excel.Write(people, @"C:\exports\people.xlsx", "People");

List<Person> imported = excel.Read<Person>(@"C:\exports\people.xlsx", "People");

AddExcelUtilAsSingleton() and AddExcelUtilAsScoped() register the same stateless utility with different DI lifetimes. Each operation creates and disposes its own workbook; no workbook or file handle is retained by the service.

Mapping behavior

  • The first used row is treated as the header row. Each subsequent used row creates one T.
  • Header matching is ordinal and case-sensitive. Extra columns are ignored; a missing mapped column or blank cell leaves the property's constructor/default value unchanged.
  • Duplicate worksheet headers resolve to the first matching column.
  • Writing uses the mapped public properties as columns and calls ToString() for non-null values, so cells are written as text. Reading gets cell values as text and applies the package's basic property conversion.
  • An empty worksheet returns an empty list. A missing file or worksheet, an unreadable workbook, or a failed type conversion is reported by the underlying API.

Write creates a new workbook containing the requested sheet and overwrites the destination path; it does not append to or preserve an existing workbook, formatting, formulas, or other sheets. Ensure the parent directory exists and use a temporary file plus an atomic replace when a partially written destination is unacceptable.

Both APIs are synchronous and ClosedXML loads workbook data in memory. Apply file-size and decompression limits before accepting untrusted uploads, and avoid using this utility for very large streaming imports or exports.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
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
11.0.376 102 11/11/2026
11.0.375 47 11/11/2026
11.0.373 66 11/11/2026
11.0.372 44 11/11/2026
11.0.371 47 11/11/2026
11.0.370 47 11/11/2026
11.0.369 54 11/11/2026
11.0.368 226 11/3/2026
11.0.367 99 11/3/2026
11.0.366 101 11/2/2026
11.0.365 140 10/27/2026
11.0.364 107 10/26/2026
11.0.363 104 10/26/2026
11.0.362 99 10/26/2026
4.0.361 445 10/15/2026
4.0.360 110 10/14/2026
4.0.359 107 10/14/2026
4.0.356 107 10/14/2026
4.0.355 108 10/14/2026
4.0.348 106 10/13/2026
Loading failed

Updated Soenneker.Extensions.String to 11.0.820