Skip to content

Update documentation for NU1011 error indicating how to allow floating versions with central package management #12919

Closed
NuGet/docs.microsoft.com-nuget
#3347

Description

Image for: Description

As part of NuGet/NuGet.Client#5440 we'll be allowing users to enable floating versions with central package management (CPM). We'll need to update the documentation for the NU1011 error to explain how to enable the functionality since it will remain off by default.

https://github.com/NuGet/docs.microsoft.com-nuget/blob/main/docs/reference/errors-and-warnings/NU1011.md

Proposed wording:

Solution

NuGet recommends not using floating versions with central package management and instead encourages users change the floating versions to a non floating version range.

If changing to non floating versions is not possible, users can enable the functionality by setting the MSBuild property CentralPackageFloatingVersionsEnabled to true in an individual project or a common import like Directory.Build.props:

<PropertyGroup>
  <CentralPackageFloatingVersionsEnabled>true</CentralPackageFloatingVersionsEnabled>
</PropertyGroup>

NOTE: The use of floating versions can introduce non-deterministic NuGet restores as described above and is not recommended.

Metadata

Image for: Metadata

Metadata

Image for: Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

Image for: Issue actions