Limits of NuGet floating version ranges for zero‑downtime migration
0 reputation · 19 Apr 2026, 00:10 UTC
0 reputation · 19 Apr 2026, 00:10 UTC
Goal: achieve zero‑downtime migration of a small .NET application while keeping dependencies up to date.
Constraint: the build must remain deterministic across environments, yet teams often prefer floating ranges like 1.0.* to receive automatic patch updates without editing the project file.
Uncertainty: it is unclear whether relying on such floating ranges introduces non‑deterministic restores that could jeopardize the migration guarantee, or whether a lock‑file‑only approach sacrifices the benefit of automatic updates.
Does using a floating version range lead to non‑deterministic builds that affect zero‑downtime guarantees? Should lock files be committed and used exclusively, or can they coexist with floating ranges? Which version‑range strategy provides predictable upgrades without risking breaking changes during migration?
Using a floating range like 1.0.* does not make the build non‑deterministic by itself; NuGet resolves the range to the highest compatible patch at restore time and writes that exact version into the lock file (project.assets.json). If the lock file is regenerated on every deployment, the selected patch may change and could introduce a breaking update, jeopardising zero‑downtime guarantees. To keep the migration safe, commit the lock file and use it exclusively for all environments, or generate the lock file once in CI and then treat it as immutable.
1.0.* as “any version with the same major/minor, highest patch at restore time” (research).1.0.*‑*).If your CI pipeline runs dotnet restore (or nuget restore) on every build/deploy, the floating range is re‑evaluated each time. A newly published patch that satisfies the range will be selected, potentially changing the runtime version between the old and new instances during a rolling update. When that patch contains a breaking change, the older instance may fail with MissingMethodException or TypeLoadException, breaking the zero‑downtime guarantee.
1.0.*) in .csproj to allow automatic patch selection during the initial lock‑file generation.project.assets.json. Inspect the file to confirm the exact patch version that was chosen.assemblyBinding redirects in app.config or web.config to allow both old and new versions to load side‑by‑side during the migration window.Missing diagnostic detail: Do you currently regenerate the lock file on each deployment (i.e., run restore every time), or do you rely on an existing committed lock file? Knowing this will confirm whether the floating range is being re‑evaluated and thus whether the lock‑file‑only approach is needed.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.