Fix it fast
Most likely: A PackageVersion item in Central Package Management uses a floating version such as 1.*, and NuGet blocks that by default for reproducible restores.
Confirm this is your error
Match the output and confirm you are troubleshooting the same failure.
error NU1011: The following PackageVersion items cannot specify a floating version: My.Package. For more information ... https://aka.ms/nu1011 Check the cause
Run focused checks to identify what is failing in this environment.
grep -R -n "<PackageVersion" Directory.Packages.props *.props
dotnet restore -v normal Apply the safe fix
Use the smallest safe change that addresses the confirmed cause.
# Replace the floating PackageVersion with an exact version in Directory.Packages.props.
# Example: change Version="1.*" to Version="1.2.3".
dotnet restore
dotnet build Verify it works
Repeat the relevant checks and confirm the original error is gone.
dotnet restore
dotnet list package Avoid unsafe shortcuts
Keep security and data protections in place while troubleshooting.
- Do not use floating versions in
PackageVersionitems unless the repo intentionally enables that CPM behavior. - Do not move versions back into each
PackageReferenceunless you intentionally stop using Central Package Management. - Do not use broad floating ranges for CI builds that need reproducible dependency resolution.
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).
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>