Closed maslewandowski closed 1 year ago
Yeah, the Azure Artifacts team doesn't care. They have only exposed the image in the Azure Artefacts feed if it is contained in the PackageIconUrl
field.
So, Microsoft recommends deprecating the PackageIconUrl
property in favor of the PackageIcon
field and using an embedded image in the NuGet package, but this is completely unsupported by Azure DevOps. So if you try to embed the icon in the NuGet package in the recommended way, you'll only ever see the default NuGet image in both Visual Studio and the DevOps Azure Artifact list.
Your option is either ignore the recommendation and continue to use the PackageIconUrl
field, or move to PackageIcon
and host your package somewhere other than Azure Artifacts.
There have been issues created for this going back 4 years, but apparently agreeing to and then implementing a spec is too much for teams within the Microsoft organization to accomplish.
Tough for us customers, I guess!
Seems to be fixed, because now I can see those icons.
Interesting, I'll check this out today and see!
@maslewandowski Can you share your package project file? I've just switched over a package from PackageIconUrl
to PackageIcon
and it's definitely not showing the image in DevOps or in VS, despite the image being bundled into the NuGet package. Thanks 👍
<Project>
<PropertyGroup>
<PackageIcon>icon.jpeg</PackageIcon>
</PropertyGroup>
<ItemGroup>
<None Include="icon.jpeg" Pack="true" Visible="false" PackagePath=""/>
</ItemGroup>
</Project>
hope it helps
This is exactly what I have in my NuGet config, it definitely is not showing the package icon in Visual Studio or on the DevOps artifact feed.
Is there a sample project? Seemed to work for me, here's my project https://github.com/WeihanLi/nocker and the NuGet package https://www.nuget.org/packages/nocker
I appreciate the help, but that's being hosted on NuGet and not via Azure Artifacts, which is what this issue is about.
I've just dug into my Azure Artifacts feed, it looks like the iconUrl
is being returned in the feeds now.
Feed example: https://pkgs.dev.azure.com/{teamName}/_packaging/{feedId}/nuget/v3/query2/?prerelease=true&semVerLevel=2.0.0
returns my feed:
{
"@context": {
"@vocab": "http://schema.nuget.org/schema#",
"comment": "http://www.w3.org/2000/01/rdf-schema#comment",
"label": "http://www.w3.org/2000/01/rdf-schema#label"
},
"data": [
{
"@id": "",
"@type": "Package",
"id": "TestPackage",
"version": "7.0.0-beta.1",
"description": "Package description.",
"versions": [
{
"@id": "TestPackage",
"downloads": 0,
"version": "7.0.0-beta.1"
}
],
"authors": [
"authorName"
],
"iconUrl": "https://pkgs.dev.azure.com/{teamName}/_packaging/{feedId}/nuget/v3/flat2/testpackage/7.0.0-beta.1/testpackage.7.0.0-beta.1.nupkg?extract=Icon.png",
"licenseUrl": "",
"projectUrl": "https://{teamName}@dev.azure.com/{teamName}/{feedName}/_git/TestPackage",
"registration": "",
"summary": null,
"tags": null,
"title": null
}
]
}
So it looks like the icon has indeed been added to the DevOps NuGet feed. However, when viewing the iconUrl
above, I get the following error:
{
"$id": "1",
"innerException": null,
"message": "TF400813: The user 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' is not authorized to access this resource.",
"typeName": "Microsoft.TeamFoundation.Framework.Server.UnauthorizedRequestException, Microsoft.TeamFoundation.Framework.Server",
"typeKey": "UnauthorizedRequestException",
"errorCode": 0,
"eventId": 3000
}
Seems that there is some kind of permission issue. I'll keep digging.
VS2022 issues seems to be authorization based - have reported to the VS team at https://developercommunity.visualstudio.com/t/post/10433567.
I assume that the DevOps frontend is similar. @maslewandowski could you prove a screenshot showing custom icons in your private feed on DevOps?
I have followed your sample but the icon is not showing up in azure artifacts.
Project File:
Project in Solution Explorer
Image Properties
What am I doing wrong?
Thanks for help.
P.S.: Azure Artifacts