Skip to content

Commit 00b5fc6

Browse files
author
Fernando Aguilar
committed
Documented error codes
1 parent 81f8285 commit 00b5fc6

File tree

3 files changed

+146
-0
lines changed

3 files changed

+146
-0
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
title: NuGet Error NU5046
3+
description: NU5046 Error code
4+
author: dominoFire
5+
ms.author: kapenaga
6+
ms.date: 9/4/2019
7+
ms.topic: reference
8+
ms.reviewer: karan
9+
f1_keywords:
10+
- NU5046
11+
---
12+
13+
# NuGet Error NU5046
14+
15+
<pre>The icon file 'Icon.png' does not exist in the package.</pre>
16+
17+
18+
# Issue
19+
20+
NuGet is unable find the local file that is marked as the package icon.
21+
22+
23+
# Solution
24+
25+
- Make sure that the file that is marked as the package icon exists and it is readable.
26+
- Ensure that the file is referenced in the nuspec or in the project file.
27+
* When you are creating a package from a nuspec file, make sure to include the icon file in the `<files/>` section:
28+
29+
```xml
30+
<package>
31+
<metadata>
32+
<id>sample.lib</id>
33+
<version>0.0.1</version>
34+
<authors>nuget</authors>
35+
<owners>nuget</owners>
36+
<license type="expression">MIT</license>
37+
<description>Package containing the icon file</description>
38+
<icon>icon.jpg</icon>
39+
</metadata>
40+
<files>
41+
<file src="icon.jpg" />
42+
</files>
43+
</package>
44+
```
45+
46+
* When creating a package from a MSBuild project file, make sure to reference the icon file in the project, as follows:
47+
48+
```xml
49+
<Project Sdk="Microsoft.NET.Sdk">
50+
<PropertyGroup>
51+
<TargetFramework>netstandard2.0</TargetFramework>
52+
<PackageIcon>icon.jpg</PackageIcon>
53+
</PropertyGroup>
54+
<ItemGroup>
55+
<None Include="icon.jpg" Pack="true" PackagePath="" />
56+
</ItemGroup>
57+
</Project>
58+
```
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
title: NuGet Error NU5047
3+
description: NU5047 Error code
4+
author: dominoFire
5+
ms.author: kapenaga
6+
ms.date: 9/4/2019
7+
ms.topic: reference
8+
ms.reviewer: karan
9+
f1_keywords:
10+
- NU5047
11+
---
12+
13+
# NuGet Error NU5047
14+
15+
<pre>The icon file size must not exceed 1 megabyte.</pre>
16+
17+
18+
# Issue
19+
20+
The file that is specified as the package icon has a filesize larger than 1 megabyte (MB). NuGet only allow icons whose filesize is less than 1 MB.
21+
22+
23+
# Solution
24+
25+
Use an image editor program to edit and downsize the package icon.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
title: NuGet Error NU5048
3+
description: NU5048 Error code
4+
author: dominoFire
5+
ms.author: kapenaga
6+
ms.date: 9/4/2019
7+
ms.topic: reference
8+
ms.reviewer: karan
9+
f1_keywords:
10+
- NU5048
11+
---
12+
13+
# NuGet Error NU5048
14+
15+
<pre>The 'PackageIconUrl'/'iconUrl' element is deprecated. Consider using the 'PackageIcon'/'icon' element instead. Learn more at https://aka.ms/deprecateIconUrl</pre>
16+
17+
18+
# Issue
19+
20+
Icon URL is deprecated in favor of embedding the icon inside the NuGet package. Possible causes are:
21+
22+
- When creating a package from a nuspec file, it contains a `<iconUrl/>` entry.
23+
- When creating a package from a MSBuild project file, it contains a `<PackageIconUrl>` property.
24+
25+
26+
# Solution
27+
28+
To stop seeing this warning, add an embedded icon to your package.
29+
30+
For nuspec files, add an `<icon/>` entry that points to the file that will be the package icon:
31+
32+
```xml
33+
<package>
34+
<metadata>
35+
<id>sample.lib</id>
36+
<version>0.0.1</version>
37+
<authors>nuget</authors>
38+
<owners>nuget</owners>
39+
<license type="expression">MIT</license>
40+
<description>Package containing the icon file</description>
41+
<icon>icon.jpg</icon>
42+
</metadata>
43+
<files>
44+
<file src="icon.jpg" />
45+
</files>
46+
</package>
47+
```
48+
49+
For MSBuild project files, add an `<PackageIcon/>` property, as follows:
50+
51+
```xml
52+
<Project Sdk="Microsoft.NET.Sdk">
53+
<PropertyGroup>
54+
<TargetFramework>netstandard2.0</TargetFramework>
55+
<PackageIcon>icon.jpg</PackageIcon>
56+
</PropertyGroup>
57+
<ItemGroup>
58+
<None Include="icon.jpg" Pack="true" PackagePath="" />
59+
</ItemGroup>
60+
</Project>
61+
```
62+
63+
To learn more about embedded icons in NuGet and the Icon URL deprecation efforts, see https://aka.ms/deprecateIconUrl

0 commit comments

Comments
 (0)