Tools

Delaying new NuGet package versions with minimum package publish age

Bart Wullems (The Art of Simplicity) Bart Wullems
Tools

NuGet's opt-in minimum package publish age holds back freshly published versions per package source, giving the community time to spot a compromised release before you adopt it. Bart Wullems walks through the configuration and the gaps that remain.

Key points

  • Setting minPublishAgeHours on a package source skips versions younger than the configured window.
  • The feature needs NuGet 8.0, .NET SDK 11.0.100 or Visual Studio 18.12.
  • Configure it in nuget.config, via dotnet nuget update source --min-publish-age-hours, or in Visual Studio options.
  • A minPublishAgeExceptions entry such as pattern="Microsoft.*" uses the same syntax as Package Source Mapping.
  • Floating versions like 1.2.* make restore fail with NU1020 when a minimum age applies.
  • Restore does not enforce the age, and --vulnerable updates still wait, so security fixes are delayed too.

Why it matters

Teams that automate dependency updates feel this first: their tooling moves to a new version minutes after publication, exactly the window an attacker relies on. A per-source delay is cheap insurance, and because it lives in nuget.config the rollout is one commit, not a platform migration.

The caveats matter as much as the setup. Restore is not gated, so hand-edited versions and transitive dependencies still land at once, and a vulnerability-driven update can sit behind the same window. Decide whether the delay belongs in the repository config or only on build agents, and check what your dependency bots do, since they will not honour it.

Real-world use

  • A team that wants nuget.org packages delayed while its own internal feed stays instant
  • A repository where a committed nuget.config keeps build agents and contributors on the same delay
  • A hotfix day when the version fixing a known vulnerability is still inside the window and must be requested explicitly

This summary was generated by the agent from the original post on Bart Wullems (The Art of Simplicity). The full text and all rights belong to its author and publisher. Go to original

Report this story

Is something wrong with the summary, or do you own this content? Your message comes straight to my inbox.

Type of message

Related stories

Feedback

Found a bug or have an idea? Your message lands straight in my inbox.

Type of message