Error Knowledge Base NuGet NU1011

NU1011: PackageVersion items cannot specify a floating version

With Central Package Management enabled, floating versions in `PackageVersion` are blocked unless explicitly enabled.

What NuGet Is Rejecting

With Central Package Management enabled, floating versions in PackageVersion are blocked unless explicitly enabled.

Fix the command

Replace floating versions with explicit versions, which is the recommended fix, and if needed, explicitly enable floating versions for CPM per the NU1011 guidance, then restore with dotnet restore.

Validation

Re-run the failing command and confirm the original code/message is gone, and confirm expected artifacts or outputs exist (packages restored, build/publish succeeds).

Typical Output

error NU1011: The following PackageVersion items cannot specify a floating version: My.Package. For more information ... https://aka.ms/nu1011

Why the Command Was Rejected

Usually this comes down to a PackageVersion uses a floating version such as 1.* or * under CPM, or a shared Directory.Packages.props introduced floating versions unintentionally.

Re-run the Minimal Correct Command

dotnet restore succeeds with NU1011 gone.

Resolved versions remain stable across machines and agents.

Mechanism

CPM centralizes versions in Directory.Packages.props. NuGet enforces determinism by disallowing floating versions by default and emits NU1011.

Avoid Command and Config Drift

To prevent this, use dependency update automation instead of floating versions, and review Directory.Packages.props changes via PR and CI restore.

Docs and source code

NU1011 CPM floating version message

Message template for the CPM floating version rule. - GitHub

  <data name="Error_CentralPackageManagement_FloatingVersionsNotAllowed" xml:space="preserve">
    <value>The following PackageVersion items cannot specify a floating version: {0}. For more information on how to enable this functionality for projects using Central Package Management, visit https://aka.ms/nu1011</value>
    <comment>
      0 - The comma delimited list of package names that specified a floating version.
      Do not localize `PackageVersion`
  </comment>
  </data>

Need help or found a mistake? Contact RepoFlow support for questions.

Join our mailing list