Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update NU1011 to include information on how to enable floating versions in CPM #3347

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions docs/reference/errors-and-warnings/NU1011.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ f1_keywords:

### Issue

`<PackageVersion />` items cannot contain floating versions. NuGet's central package management (CPM) is considered an enterprise-level feature which provides easier version
By default, `<PackageVersion />` items cannot contain floating versions. NuGet's central package management (CPM) is considered an enterprise-level feature which provides easier version
management at scale as well as deterministic and secure restores. The use of floating versions introduces the possibility for a bad package to be introduced into your build
after it has been pushed to a feed. This can lead to a situation where you made no changes in your repository but suddenly something is broken and there is no way for you to
get back into a good state without removing the floating version or pushing a newer version of the package which is fixed. Using non-floating versions means that every upgrade
Expand All @@ -30,4 +30,11 @@ commit in your repository.

### Solution

Change the floating version to a [non floating version range](../../concepts/Package-Versioning.md#version-ranges).
It is recommended to change the floating version to a [non floating version range](../../concepts/Package-Versioning.md#version-ranges). If that is not possible, you can enable
floating versions with CPM by setting an MSBuild property:

```xml
<PropertyGroup>
<CentralPackageFloatingVersionsEnabled>true</CentralPackageFloatingVersionsEnabled>
</PropertyGroup>
```