8
votes

My team is working on a TFS/VSTS custom build task that utilizes the vsts-task-lib.

We followed the instructions on this github page to include it with your custom task.

I have the vsts-task-lib installed locally for interactive testing, and that is executing ok. I am able to get the extension uploaded and installed into my VSTS account/project.

However, when I line everything up and execute a Release on VSTS, I get the following:

2016-12-22T21:41:27.4700501Z ##[section]Starting: ApprendaDeploy 

2016-12-22T21:41:27.5110766Z ==============================================================================

2016-12-22T21:41:27.5120761Z Task         : Deploy App on Apprenda

2016-12-22T21:41:27.5120761Z Description  : This task deploys your application onto ACP

2016-12-22T21:41:27.5120761Z Version      : 0.1.0

2016-12-22T21:41:27.5120761Z Author       : Apprenda

2016-12-22T21:41:27.5120761Z Help         : Replace with markdown to show in help

2016-12-22T21:41:27.5120761Z ==============================================================================

2016-12-22T21:41:27.8483971Z ##[error]File not found: 'C:\a\_tasks\ApprendaDeploy_fb765e50-c211-11e6-9471-0d5c99017b97\0.1.0\ps_modules\VstsTaskSdk\VstsTaskSdk.psd1'

2016-12-22T21:41:27.8553964Z ##[section]Finishing: ApprendaDeploy 

I'm using vsts-task-lib v0.8.0 and my task root file directory looks like this:

|-- apprendaDeploy <task root>
  |----- ps_modules
     |----- VstsTaskSDK
        |----- 0.8.0
            |------ <corresponding sdk files, including VstsTaskSdk.psd1>
  |----- common.ps1
  |----- deploy.ps1
  |----- icon.png
  |----- task.json

Any ideas?

1
Looks like you're missing the version in your path? Should be ...\VstsTaskSDK\0.8.0\VstsTaskSdk.psd1. Or try moving the SDK files out of the 0.8.0 folder so that it's sitting in the VstsTaskSDK folder. - Alex Wiese
Can you share that extension files on the OneDrive? - starian chen-MSFT
remove the version altogether. it should be ps_modules/vststasksdk/vststasksdk.psd1 - jessehouwing

1 Answers

13
votes

You need to move the SDK files to ...\VstsTaskSdk\* rather than them being in a version specific folder. I ran into the same issue and resolved it this way.