Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions docs/core/compatibility/10.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
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: 06/23/2025
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).

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 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

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

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 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

Add a version to the package reference, for example:

```diff
- <PackageReference Include="Some.Package" />
+ <PackageReference Include="Some.Package" Version="1.2.3" />
```

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.

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

None.
4 changes: 4 additions & 0 deletions docs/core/compatibility/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 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: Windows Forms
Expand Down Expand Up @@ -1984,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
Expand Down