Git Product home page Git Product logo

Comments (9)

DaleMckeown avatar DaleMckeown commented on September 23, 2024 1

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.

https://learn.microsoft.com/en-us/nuget/create-packages/package-authoring-best-practices#package-metadata

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!

from samples.

maslewandowski avatar maslewandowski commented on September 23, 2024

Seems to be fixed, because now I can see those icons.

from samples.

DaleMckeown avatar DaleMckeown commented on September 23, 2024

Interesting, I'll check this out today and see!

from samples.

DaleMckeown avatar DaleMckeown commented on September 23, 2024

@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 👍

from samples.

WeihanLi avatar WeihanLi commented on September 23, 2024
<Project>
  <PropertyGroup>
    <PackageIcon>icon.jpeg</PackageIcon>
  </PropertyGroup>
  <ItemGroup>
    <None Include="icon.jpeg" Pack="true" Visible="false" PackagePath=""/>
  </ItemGroup>
</Project>

hope it helps

from samples.

DaleMckeown avatar DaleMckeown commented on September 23, 2024

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.

from samples.

WeihanLi avatar WeihanLi commented on September 23, 2024

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

from samples.

DaleMckeown avatar DaleMckeown commented on September 23, 2024

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.

from samples.

DaleMckeown avatar DaleMckeown commented on September 23, 2024

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?

from samples.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.