From 4ab3dd127eebe7637d01f7f39e943e16f21ab8d5 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Mon, 23 Jun 2025 13:26:25 +0000
Subject: [PATCH 1/3] Initial plan for issue
From aff37f03758504f5589f32d21c37945a46d028e8 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Mon, 23 Jun 2025 13:33:15 +0000
Subject: [PATCH 2/3] Add breaking change documentation for PackageReference
version requirement
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
---
docs/core/compatibility/10.0.md | 1 +
.../10.0/nu1015-packagereference-version.md | 50 +++++++++++++++++++
docs/core/compatibility/toc.yml | 2 +
3 files changed, 53 insertions(+)
create mode 100644 docs/core/compatibility/sdk/10.0/nu1015-packagereference-version.md
diff --git a/docs/core/compatibility/10.0.md b/docs/core/compatibility/10.0.md
index a3969d610efc7..7ff7591a9b66a 100644
--- a/docs/core/compatibility/10.0.md
+++ b/docs/core/compatibility/10.0.md
@@ -78,6 +78,7 @@ If you're migrating an app to .NET 10, the breaking changes listed here might af
| [MSBUILDCUSTOMBUILDEVENTWARNING escape hatch removed](sdk/10.0/custom-build-event-warning.md) | Behavioral change | Preview 1 |
| [MSBuild custom culture resource handling](sdk/10.0/msbuild-custom-culture.md) | Behavioral change | Preview 1 |
| [NU1510 is raised for direct references pruned by NuGet](sdk/10.0/nu1510-pruned-references.md) | Source incompatible | Preview 1 |
+| [PackageReference without a version will raise an error](sdk/10.0/nu1015-packagereference-version.md) | Behavioral change | Preview 6 |
| [HTTP warnings promoted to errors in `dotnet package list` and `dotnet package search`](sdk/10.0/http-warnings-to-errors.md) | Behavioral/source incompatible change | Preview 4 |
## Windows Forms
diff --git a/docs/core/compatibility/sdk/10.0/nu1015-packagereference-version.md b/docs/core/compatibility/sdk/10.0/nu1015-packagereference-version.md
new file mode 100644
index 0000000000000..ff9bf053fced0
--- /dev/null
+++ b/docs/core/compatibility/sdk/10.0/nu1015-packagereference-version.md
@@ -0,0 +1,50 @@
+---
+title: "Breaking change - PackageReference without a version will raise an error"
+description: "Learn about the breaking change in .NET 10 where PackageReference without a version raises NU1015 error instead of NU1604 warning."
+ms.date: 12/17/2024
+ai-usage: ai-assisted
+ms.custom: https://github.com/dotnet/docs/issues/46386
+---
+
+# PackageReference without a version will raise an error
+
+Starting in .NET 10, NuGet raises a [`NU1015` error](/nuget/reference/errors-and-warnings/nu1015) when a `PackageReference` item doesn't have a version specified, instead of the previous [`NU1604` warning](/nuget/reference/errors-and-warnings/nu1604).
+
+## Version introduced
+
+.NET 10 Preview 6
+
+## Previous behavior
+
+Previously, NuGet raised a NU1604 warning with the text "Project dependency 'PackageA' does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results."
+
+## New behavior
+
+NuGet now raises a NU1015 error with the text "The following PackageReference item(s) do not have a version specified: PackageA"
+
+## Type of breaking change
+
+This is a [behavioral change](../../categories.md#behavioral-change).
+
+## Reason for change
+
+The "no lower bound" message was confusing, and it was unclear how to fix the issue. Additionally, NuGet would end up restoring the lowest version for that package, which is rarely what developers want. This change provides clearer and more actionable error messages when the version metadata is missing.
+
+There's no change when using Central Package Management, since by design the PackageReference XML should not have a version in that scenario.
+
+## Recommended action
+
+Add a version to the package reference, for example:
+
+```diff
+-
++
+```
+
+If the lowest package version is desired, then use `Version="0.0.0"`. In this case, NuGet will raise warning NU1603, rather than the previous NU1604.
+
+`SdkAnalysisLevel` can be set to `9.0.300` or lower, and NuGet will revert to the previous warning. However, this will affect all features that gate on SdkAnalysisLevel.
+
+## Affected APIs
+
+None.
diff --git a/docs/core/compatibility/toc.yml b/docs/core/compatibility/toc.yml
index bd8dd49dadfdc..b2a828ace7463 100644
--- a/docs/core/compatibility/toc.yml
+++ b/docs/core/compatibility/toc.yml
@@ -74,6 +74,8 @@ items:
href: sdk/10.0/msbuild-custom-culture.md
- name: NU1510 is raised for direct references pruned by NuGet
href: sdk/10.0/nu1510-pruned-references.md
+ - name: PackageReference without a version will raise an error
+ href: sdk/10.0/nu1015-packagereference-version.md
- name: HTTP warnings promoted to errors in package list and search
href: sdk/10.0/http-warnings-to-errors.md
- name: Windows Forms
From 73e03c8fc417ff662ce2471f6538f5858e2f2686 Mon Sep 17 00:00:00 2001
From: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
Date: Mon, 23 Jun 2025 15:56:18 +0200
Subject: [PATCH 3/3] human edits
---
docs/core/compatibility/10.0.md | 2 +-
.../10.0/nu1015-packagereference-version.md | 20 +++++++++++--------
docs/core/compatibility/toc.yml | 4 +++-
3 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/docs/core/compatibility/10.0.md b/docs/core/compatibility/10.0.md
index 7ff7591a9b66a..1277980ed562d 100644
--- a/docs/core/compatibility/10.0.md
+++ b/docs/core/compatibility/10.0.md
@@ -78,7 +78,7 @@ If you're migrating an app to .NET 10, the breaking changes listed here might af
| [MSBUILDCUSTOMBUILDEVENTWARNING escape hatch removed](sdk/10.0/custom-build-event-warning.md) | Behavioral change | Preview 1 |
| [MSBuild custom culture resource handling](sdk/10.0/msbuild-custom-culture.md) | Behavioral change | Preview 1 |
| [NU1510 is raised for direct references pruned by NuGet](sdk/10.0/nu1510-pruned-references.md) | Source incompatible | Preview 1 |
-| [PackageReference without a version will raise an error](sdk/10.0/nu1015-packagereference-version.md) | Behavioral change | Preview 6 |
+| [PackageReference without a version raises an error](sdk/10.0/nu1015-packagereference-version.md) | Behavioral change | Preview 6 |
| [HTTP warnings promoted to errors in `dotnet package list` and `dotnet package search`](sdk/10.0/http-warnings-to-errors.md) | Behavioral/source incompatible change | Preview 4 |
## Windows Forms
diff --git a/docs/core/compatibility/sdk/10.0/nu1015-packagereference-version.md b/docs/core/compatibility/sdk/10.0/nu1015-packagereference-version.md
index ff9bf053fced0..b720de903c511 100644
--- a/docs/core/compatibility/sdk/10.0/nu1015-packagereference-version.md
+++ b/docs/core/compatibility/sdk/10.0/nu1015-packagereference-version.md
@@ -1,7 +1,7 @@
---
-title: "Breaking change - PackageReference without a version will raise an error"
+title: "Breaking change - PackageReference without a version raises an error"
description: "Learn about the breaking change in .NET 10 where PackageReference without a version raises NU1015 error instead of NU1604 warning."
-ms.date: 12/17/2024
+ms.date: 06/23/2025
ai-usage: ai-assisted
ms.custom: https://github.com/dotnet/docs/issues/46386
---
@@ -10,17 +10,23 @@ ms.custom: https://github.com/dotnet/docs/issues/46386
Starting in .NET 10, NuGet raises a [`NU1015` error](/nuget/reference/errors-and-warnings/nu1015) when a `PackageReference` item doesn't have a version specified, instead of the previous [`NU1604` warning](/nuget/reference/errors-and-warnings/nu1604).
+There's no change when using Central Package Management, since by design the PackageReference XML should not have a version in that scenario.
+
## Version introduced
.NET 10 Preview 6
## Previous behavior
-Previously, NuGet raised a NU1604 warning with the text "Project dependency 'PackageA' does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results."
+Previously, NuGet raised a NU1604 warning with the following text:
+
+> Project dependency 'PackageA' does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results.
## New behavior
-NuGet now raises a NU1015 error with the text "The following PackageReference item(s) do not have a version specified: PackageA"
+Starting in .NET 10, NuGet raises a NU1015 error with the following text:
+
+> The following PackageReference item(s) do not have a version specified: PackageA
## Type of breaking change
@@ -28,9 +34,7 @@ This is a [behavioral change](../../categories.md#behavioral-change).
## Reason for change
-The "no lower bound" message was confusing, and it was unclear how to fix the issue. Additionally, NuGet would end up restoring the lowest version for that package, which is rarely what developers want. This change provides clearer and more actionable error messages when the version metadata is missing.
-
-There's no change when using Central Package Management, since by design the PackageReference XML should not have a version in that scenario.
+The "no lower bound" message was confusing, and it was unclear how to fix the issue. Additionally, NuGet restored the lowest version for that package, which is rarely what developers want. This change provides clearer and more actionable error messages when the version metadata is missing.
## Recommended action
@@ -43,7 +47,7 @@ Add a version to the package reference, for example:
If the lowest package version is desired, then use `Version="0.0.0"`. In this case, NuGet will raise warning NU1603, rather than the previous NU1604.
-`SdkAnalysisLevel` can be set to `9.0.300` or lower, and NuGet will revert to the previous warning. However, this will affect all features that gate on SdkAnalysisLevel.
+To revert to the previous warning, you can set `SdkAnalysisLevel` to `9.0.300` or lower. However, this will affect all features that gate on `SdkAnalysisLevel`.
## Affected APIs
diff --git a/docs/core/compatibility/toc.yml b/docs/core/compatibility/toc.yml
index b2a828ace7463..c6abaa3931cd7 100644
--- a/docs/core/compatibility/toc.yml
+++ b/docs/core/compatibility/toc.yml
@@ -74,7 +74,7 @@ items:
href: sdk/10.0/msbuild-custom-culture.md
- name: NU1510 is raised for direct references pruned by NuGet
href: sdk/10.0/nu1510-pruned-references.md
- - name: PackageReference without a version will raise an error
+ - name: PackageReference without a version raises error
href: sdk/10.0/nu1015-packagereference-version.md
- name: HTTP warnings promoted to errors in package list and search
href: sdk/10.0/http-warnings-to-errors.md
@@ -1986,6 +1986,8 @@ items:
href: sdk/10.0/msbuild-custom-culture.md
- name: NU1510 is raised for direct references pruned by NuGet
href: sdk/10.0/nu1510-pruned-references.md
+ - name: PackageReference without a version raises error
+ href: sdk/10.0/nu1015-packagereference-version.md
- name: HTTP warnings promoted to errors in package list and search
href: sdk/10.0/http-warnings-to-errors.md
- name: .NET 9