Skip to content

Commit 6d3ed8f

Browse files
authored
Add NU1015 docs (#3437)
1 parent 763eb62 commit 6d3ed8f

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

docs/TOC.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@
153153
### [NU1011](reference/errors-and-warnings/NU1011.md)
154154
### [NU1012](reference/errors-and-warnings/NU1012.md)
155155
### [NU1014](reference/errors-and-warnings/NU1014.md)
156+
### [NU1015](reference/errors-and-warnings/NU1015.md)
156157
### [NU1100](reference/errors-and-warnings/NU1100.md)
157158
### [NU1101](reference/errors-and-warnings/NU1101.md)
158159
### [NU1102](reference/errors-and-warnings/NU1102.md)

docs/reference/Errors-and-Warnings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ NuGet supports the following configuration properties.
2727

2828
| Group | Error Numbers |
2929
| --- | --- |
30-
| Invalid input errors | [NU1001](./errors-and-warnings/NU1001.md), [NU1002](./errors-and-warnings/NU1002.md), [NU1003](./errors-and-warnings/NU1003.md), [NU1004](./errors-and-warnings/NU1004.md), [NU1005](./errors-and-warnings/NU1005.md), [NU1006](./errors-and-warnings/NU1006.md), [NU1007](./errors-and-warnings/NU1007.md), [NU1008](./errors-and-warnings/NU1008.md), [NU1009](./errors-and-warnings/NU1009.md), [NU1010](./errors-and-warnings/NU1010.md), [NU1011](./errors-and-warnings/NU1011.md), [NU1012](./errors-and-warnings/NU1012.md), |
30+
| Invalid input errors | [NU1001](./errors-and-warnings/NU1001.md), [NU1002](./errors-and-warnings/NU1002.md), [NU1003](./errors-and-warnings/NU1003.md), [NU1004](./errors-and-warnings/NU1004.md), [NU1005](./errors-and-warnings/NU1005.md), [NU1006](./errors-and-warnings/NU1006.md), [NU1007](./errors-and-warnings/NU1007.md), [NU1008](./errors-and-warnings/NU1008.md), [NU1009](./errors-and-warnings/NU1009.md), [NU1010](./errors-and-warnings/NU1010.md), [NU1011](./errors-and-warnings/NU1011.md), [NU1012](./errors-and-warnings/NU1012.md), [NU1013](./errors-and-warnings/NU1013.md), [NU1014](./errors-and-warnings/NU1014.md), [NU1015](./errors-and-warnings/NU1015.md) |
3131
| Missing package and project errors | [NU1100](./errors-and-warnings/NU1100.md), [NU1101](./errors-and-warnings/NU1101.md), [NU1102](./errors-and-warnings/NU1102.md), [NU1103](./errors-and-warnings/NU1103.md), [NU1104](./errors-and-warnings/NU1104.md), [NU1105](./errors-and-warnings/NU1105.md), [NU1106](./errors-and-warnings/NU1106.md), [NU1107](./errors-and-warnings/NU1107.md), [NU1108](./errors-and-warnings/NU1108.md), [NU1109](./errors-and-warnings/NU1109.md) |
3232
| Package source mapping errors | [NU1110](./errors-and-warnings/NU1110.md) |
3333
| Compatibility errors | [NU1201](./errors-and-warnings/NU1201.md), [NU1202](./errors-and-warnings/NU1202.md), [NU1203](./errors-and-warnings/NU1203.md), [NU1204](./errors-and-warnings/NU1204.md), [NU1401](./errors-and-warnings/NU1401.md), [NU1402](./errors-and-warnings/NU1402.md), [NU1403](./errors-and-warnings/NU1403.md) |
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
title: NuGet Error NU1015
3+
description: NU1015 error code
4+
author: zivkan
5+
ms.author: zivkan
6+
ms.date: 06/04/2025
7+
ms.topic: reference
8+
f1_keywords:
9+
- "NU1015"
10+
---
11+
12+
# NuGet Error NU1015
13+
14+
## Scenario
15+
16+
> The following PackageReference item(s) do not have a version specified: Contoso.Utilities
17+
18+
### Issue
19+
20+
Your project file, or a file it imports (for example `Directory.Build.props`) has defined a `PackageReference` without a version.
21+
22+
Projects using [Central Package Management (CPM)](../../consume-packages/Central-Package-Management.md) do not define a version on the PackageReference item, so this error could happen if a project has CPM disabled by accident, or if a project or `PackageReference` using CPM is copied into another solution that is not using CPM.
23+
24+
### Solution
25+
26+
- Add a version to the package reference
27+
28+
If you edit your project, a package reference will generally look similar to `<PackageReference Include="Contoso.Utilities" Version="1.2.3" />`, although [MSBuild allows multiple syntaxes to define item metadata](/visualstudio/msbuild/msbuild-items).
29+
Add the `Version="1.2.3"` item metadata as defined.
30+
31+
- Check Central Package Management configuration
32+
33+
This NU1015 error only happens when CPM is disabled.
34+
If Central Package Management (CPM) is intended to be enabled, check your configuration files to investigate why it is disabled.

0 commit comments

Comments
 (0)