| title | NuGet Error NU5046 | |
|---|---|---|
| description | NU5046 Error code | |
| author | JonDouglas | |
| ms.author | jodou | |
| ms.date | 9/4/2019 | |
| ms.topic | reference | |
| ms.reviewer | karann | |
| f1_keywords |
|
The icon file 'icon.png' does not exist in the package.
NuGet is unable find the icon file in the package.
- Make sure that the file that is marked as the package icon exists at the source and it is readable, and the target matches the path expected by the
iconproperty. - Ensure that the file is referenced in the nuspec or in the project file.
-
When creating a package from a MSBuild project file, make sure to reference the icon file in the project, as follows:
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> ... <PackageIcon>icon.png</PackageIcon> ... </PropertyGroup> <ItemGroup> ... <None Include="images\icon.png" Pack="true" PackagePath=""/> ... </ItemGroup> </Project>
-
When you are creating a package from a nuspec file, make sure to include the icon file in the
<files/>section:<package> <metadata> ... <icon>images\icon.png</icon> ... </metadata> <files> ... <file src="..\icon.png" target="images\" /> ... </files> </package>
-