NuGet Warning NU5048
The 'PackageIconUrl'/'iconUrl' element is deprecated. Consider using the 'PackageIcon'/'icon' element instead. Learn more at https://aka.ms/deprecateIconUrl
Issue
Icon URL is deprecated in favor of embedding the icon inside the NuGet package. Possible causes are:
- When creating a package from a nuspec file, it contains a
<iconUrl/>
entry. - When creating a package from a MSBuild project file, it contains a
<PackageIconUrl>
property.
Solution
To stop seeing this warning, add an embedded icon to your package.
For MSBuild project files, add an <PackageIcon/>
property, as follows:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
...
<PackageIcon>icon.png</PackageIcon>
...
</PropertyGroup>
<ItemGroup>
...
<None Include="images\icon.png" Pack="true" PackagePath=""/>
...
</ItemGroup>
</Project>
For nuspec files, add an <icon/>
entry that points to the file that will be the package icon:
<package>
<metadata>
...
<icon>images\icon.png</icon>
...
</metadata>
<files>
...
<file src="..\icon.png" target="images\" />
...
</files>
</package>
प्रतिक्रिया
https://aka.ms/ContentUserFeedback.
जल्द आ रहा है: 2024 के दौरान हम सामग्री के लिए फीडबैक तंत्र के रूप में GitHub मुद्दों को चरणबद्ध तरीके से समाप्त कर देंगे और इसे एक नई फीडबैक प्रणाली से बदल देंगे. अधिक जानकारी के लिए, देखें:के लिए प्रतिक्रिया सबमिट करें और देखें