Search code examples
tfstypescripttfsbuildazure-devops

TFS (web) gives error when building Typescript. TypeScript.targets not found


We just converted our javascript files to typescript. Everything builds locally just fine but our build in TFS (cloud version i.e. tfs.visualstudio.com) gave us the error:

The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\TypeScript\Microsoft.TypeScript.targets"
 was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

Locally we are using typescript version 0.9.1.1 and VS2012

And advise?


Solution

  • To ensure that Web projects using Microsoft.TypeScript.targets will build successfully on a build server, you have two options:

    1. Install TypeScript on the build server
    2. Copy the required files for Microsoft.TypeScript.targets to a different source-controlled folder and change the path references in the csproj file to this folder.

    More details here => http://typescript.codeplex.com/workitem/1518