Skip to content

Commit 45fb520

Browse files
authored
Document NU1018 and NU1019 (#3546)
1 parent 22629ff commit 45fb520

4 files changed

Lines changed: 103 additions & 1 deletion

File tree

docs/TOC.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,13 @@
156156
### [NU1010](reference/errors-and-warnings/NU1010.md)
157157
### [NU1011](reference/errors-and-warnings/NU1011.md)
158158
### [NU1012](reference/errors-and-warnings/NU1012.md)
159+
### [NU1013](reference/errors-and-warnings/NU1013.md)
159160
### [NU1014](reference/errors-and-warnings/NU1014.md)
160161
### [NU1015](reference/errors-and-warnings/NU1015.md)
162+
### [NU1016](reference/errors-and-warnings/NU1016.md)
163+
### [NU1017](reference/errors-and-warnings/NU1017.md)
164+
### [NU1018](reference/errors-and-warnings/NU1018.md)
165+
### [NU1019](reference/errors-and-warnings/NU1019.md)
161166
### [NU1100](reference/errors-and-warnings/NU1100.md)
162167
### [NU1101](reference/errors-and-warnings/NU1101.md)
163168
### [NU1102](reference/errors-and-warnings/NU1102.md)
@@ -290,12 +295,17 @@
290295
### [NU5035](reference/errors-and-warnings/NU5035.md)
291296
### [NU5036](reference/errors-and-warnings/NU5036.md)
292297
### [NU5037](reference/errors-and-warnings/NU5037.md)
298+
### [NU5038](reference/errors-and-warnings/NU5038.md)
299+
### [NU5039](reference/errors-and-warnings/NU5039.md)
300+
### [NU5040](reference/errors-and-warnings/NU5040.md)
301+
### [NU5041](reference/errors-and-warnings/NU5041.md)
293302
### [NU5042](reference/errors-and-warnings/NU5042.md)
294303
### [NU5045](reference/errors-and-warnings/NU5045.md)
295304
### [NU5046](reference/errors-and-warnings/NU5046.md)
296305
### [NU5047](reference/errors-and-warnings/NU5047.md)
297306
### [NU5048](reference/errors-and-warnings/NU5048.md)
298307
### [NU5049](reference/errors-and-warnings/NU5049.md)
308+
### [NU5051](reference/errors-and-warnings/NU5051.md)
299309
### [NU5100](reference/errors-and-warnings/NU5100.md)
300310
### [NU5101](reference/errors-and-warnings/NU5101.md)
301311
### [NU5102](reference/errors-and-warnings/NU5102.md)
@@ -327,6 +337,7 @@
327337
### [NU5129](reference/errors-and-warnings/NU5129.md)
328338
### [NU5130](reference/errors-and-warnings/NU5130.md)
329339
### [NU5131](reference/errors-and-warnings/NU5131.md)
340+
### [NU5133](reference/errors-and-warnings/NU5133.md)
330341
### [NU5500](reference/errors-and-warnings/NU5500.md)
331342
### [NU5501](reference/errors-and-warnings/NU5501.md)
332343
## Archived content

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), [NU1013](./errors-and-warnings/NU1013.md), [NU1014](./errors-and-warnings/NU1014.md), [NU1015](./errors-and-warnings/NU1015.md), [NU1016](./errors-and-warnings/NU1016.md), [NU1017](./errors-and-warnings/NU1017.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), [NU1016](./errors-and-warnings/NU1016.md), [NU1017](./errors-and-warnings/NU1017.md), [NU1018](./errors-and-warnings/NU1018.md), [NU1019](./errors-and-warnings/NU1019.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: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: NuGet Error NU1018
3+
description: NU1018 error code
4+
author: nkolev92
5+
ms.author: nikolev
6+
ms.date: 04/07/2026
7+
ms.topic: reference
8+
f1_keywords:
9+
- "NU1018"
10+
---
11+
12+
# NuGet Error NU1018
13+
14+
## Scenario
15+
16+
> The project 'MyProject' is attempting to restore duplicate frameworks, which are supported only in the default dependency resolver when the .NET SDK is version 10.0.300 or newer. Upgrade your .NET SDK or remove RestoreUseLegacyDependencyResolver to use this feature.
17+
18+
### Issue
19+
20+
Your project file has multiple `TargetFrameworks` entries that resolve to the same NuGet framework.
21+
This scenario is known as framework aliasing, where different TargetFramework properties map to the same underlying framework.
22+
23+
For example, a project file like the following defines two target frameworks that both resolve to the same `net9.0` NuGet framework:
24+
25+
```xml
26+
<PropertyGroup>
27+
<TargetFrameworks>net9.0-custom1;net9.0-custom2</TargetFrameworks>
28+
</PropertyGroup>
29+
```
30+
31+
Framework aliasing is supported only in the default dependency resolver, which requires .NET SDK 10.0.300 or later (`SdkAnalysisLevel` of `10.0.300` or later).
32+
When the legacy dependency resolver is active (either because the SDK version is older or because `RestoreUseLegacyDependencyResolver` is set), the assets file format doesn't support duplicate frameworks, and NuGet raises this error.
33+
34+
### Solution
35+
36+
Use one of the following approaches to resolve this error:
37+
38+
- **Upgrade to .NET SDK 10.0.300 or later**, which uses the default dependency resolver that supports framework aliasing.
39+
- **Remove the `RestoreUseLegacyDependencyResolver` property** from your project file or `Directory.Build.props`, if it's set.
40+
This allows NuGet to use the default dependency resolver.
41+
- **Remove duplicate framework entries** from your `TargetFrameworks` property so that each target framework resolves to a unique NuGet framework.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
title: NuGet Error NU1019
3+
description: NU1019 error code
4+
author: nkolev92
5+
ms.author: nikolev
6+
ms.date: 04/02/2026
7+
ms.topic: reference
8+
f1_keywords:
9+
- "NU1019"
10+
---
11+
12+
# NuGet Error NU1019
13+
14+
## Scenario
15+
16+
> The project 'MyProject' contains a TargetFramework 'net10.0/benchmark' with disallowed characters. TargetFramework names must contain only ASCII characters and must not contain path separators.
17+
18+
### Issue
19+
20+
Your project file has a `TargetFramework` or `TargetFrameworks` value that contains disallowed characters.
21+
NuGet doesn't allow the following characters in target framework names:
22+
23+
- **Path separators** (`/` or `\`): These characters break the assets file format and are always disallowed.
24+
- **Non-ASCII characters**: Target framework names must contain only ASCII characters (characters with a value of 127 or less).
25+
26+
This validation is gated behind the `SdkAnalysisLevel` property:
27+
28+
- **SDK analysis level 10.0.300 or later**: Path separators in target framework names raise an error.
29+
Non-ASCII characters raise a warning.
30+
- **SDK analysis level 11.0.100 or later**: Both path separators and non-ASCII characters raise an error.
31+
32+
### Solution
33+
34+
Rename the target framework values in your project file to use only ASCII characters and remove any path separators.
35+
36+
For example, change:
37+
38+
```xml
39+
<PropertyGroup>
40+
<TargetFramework>net10.0/benchmark</TargetFramework>
41+
</PropertyGroup>
42+
```
43+
44+
To a valid target framework name:
45+
46+
```xml
47+
<PropertyGroup>
48+
<TargetFramework>net10.0-benchmark</TargetFramework>
49+
</PropertyGroup>
50+
```

0 commit comments

Comments
 (0)