Skip to main content
Version: 2.11.10

Install Humanizer

Orientation

Install the Humanizer package in the project that produces user-facing text. This snapshot documents Humanizer 2.11.10.

Example

Install the selected release:

dotnet add package Humanizer --version 2.11.10

Then add using Humanizer; and run this verified program:

Program.cs
using System.Globalization;
using Humanizer;

CultureInfo.CurrentCulture = CultureInfo.GetCultureInfo("en-US");
CultureInfo.CurrentUICulture = CultureInfo.GetCultureInfo("en-US");

var result = TimeSpan.FromMinutes(2).Humanize();
if (result != "2 minutes")
throw new InvalidOperationException($"Unexpected result: {result}");

Console.WriteLine(result);

Humanizer 2.11.10 ships net6.0, netstandard1.0, and netstandard2.0 assets. A consuming project must target a framework compatible with one of those package assets.

Confirm the reference

Run:

dotnet list package

The project should list Humanizer at version 2.11.10. In centrally managed repositories, put the version in Directory.Packages.props and omit --version from the project command.

Pitfall

Do not treat compatibility with a netstandard asset as a claim that every consuming target framework is explicitly supported. The package metadata above is the selected-release boundary.

Version notes

The 2.11.10 Humanizer package is a metapackage over Humanizer.Core and locale packages. See package selection before replacing package references during an upgrade.