Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why TFS Build Step Extension Icon Is Missing?

I created a new extension for TFS following MS tutorial. For some reason when I'm adding Icon to my extension I can see this icon when I'm installing the extension and in the "Extension Manager" page,

But when I choose my extension from the build step menu the image is missing.

In the "vss-extension.json" file I added:

"icons": {
    "default": "images/icon.png"
}, 
"files": [
    {
        "path": "images",
        "addressable": true          
    },
    {
        "path": "dist",
        "addressable": true,
        "packagePath": "scripts"
    },
    {
        "path": "infoTab.html",
        "addressable": true
    },                   
    {
        "path": "node_modules/vss-web-extension-sdk/lib",
        "addressable": true,
        "packagePath": "lib"
    },    
    {
        "path": "buildtask"
    }       
],

The image file is 32x32

Should this image be reference in the "task.json" file as well?

like image 928
Aviram Fireberger Avatar asked Feb 05 '17 09:02

Aviram Fireberger


People also ask

How do I add an extension to TFS?

Go to your home page ( https://{server}:8080/tfs/ ). Browse for your downloaded extensions ( https://{server}:8080/tfs/_gallery ). Manage your extensions. Upload the extension that you downloaded.

What is TFS Build system in Azure?

Previously known as Team Foundation Server (TFS), Azure DevOps Server is a set of collaborative software development tools, hosted on-premises. Azure DevOps Server integrates with your existing IDE or editor, enabling your cross-functional team to work effectively on projects of all sizes.

Where can you find extensions for Azure DevOps?

The Visual Studio Marketplace is where extensions are published. They can be kept privately for you and your team or shared with the millions of developers currently using Azure DevOps.


2 Answers

The accepted answer is not correct for Microsoft Visual Studio Team Foundation Server version 15.105.25910.0. Perhaps it was correct for previous versions.

  1. The image file must be named icon.png.
  2. The image file must be in the same folder as task.json.
  3. The image file should be 32 x 32; no image scaling is applied.

The task.json file does not contain any reference to this file. It is located by using these conventions.

like image 79
rcabr Avatar answered Oct 24 '22 03:10

rcabr


The task itself has its own icon and it must be stored in the same directory as the task.json and must be called icon.png and be 32x32 pixels and optionally an additional icon.svg can be put alongside it. This has to do with the fact that one extension can contain multiple build tasks, each build task then has its own icon. It's not referenced from the task.json, the correct file name will cause it to be picked up.

For an example, check my Azure Pipelines Snyk task. Also, if this is your complete extension manifest, then it's missing the Build task contribution point:

"contributions": [
{
  "id": "buildtask",
  "type": "ms.vss-distributed-task.task",
  "targets": [
    "ms.vss-distributed-task.tasks"
  ],
  "properties": {
    "name": "buildtask"
  }
}
like image 29
jessehouwing Avatar answered Oct 24 '22 04:10

jessehouwing