Skip to main content
Version: 3.0.8

Install Humanizer

Orientation

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

Example

Install the selected release:

dotnet add package Humanizer --version 3.0.8

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 3.0.8 ships net10.0, net8.0, net48, 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 3.0.8. 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 3.0.8 Humanizer package is a metapackage over Humanizer.Core and locale packages. See package selection before replacing package references during an upgrade.