Visual Studio 在线构建中的 TypeScript

TypeScript in Visual Studio Online Build

我正在尝试使用 VisualStudio.com 托管构建为 ASP.NET MVC 4.5 项目设置 CI,该项目在构建期间使用新的 TypeScript 1.5 工具。我已经使用新的非 XAML 构建定义格式设置了我的 CI 构建定义。

我在尝试构建时遇到以下错误:

##[error](103,5): Error : Your project file uses a different version of the TypeScript compiler and tools than is currently installed on this machine. No compiler was found at C:\Program Files (x86)\Microsoft SDKs\TypeScript.5.5\tsc.exe. You may be able to fix this problem by changing the element in your project file.

我觉得奇怪的是 1.5 文件夹下多了一个 1.5 子文件夹。这是不正确的:tsc.exe 的标准安装位置是 "C:\Program Files (x86)\Microsoft SDKs\TypeScript.5\tsc.exe".

请注意,我也曾尝试将其还原为使用 1.4,但我得到了同样的错误:路径是 ...TypeScript.4.4\tsc.exe日志。

我没有直接引用 tsc.exe。以下是我的 csproj 中唯一的 TypeScript 引用:

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props')" />

<TypeScriptToolsVersion>1.5</TypeScriptToolsVersion>

我的直觉告诉我实际上安装了 TypeScript 1.5,因为我在构建日志中看到其他对 .NET 4.6 的引用(均作为 VS2015 的一部分发布),但路径不正确。而且我很确定安装了 TS 1.4。

我看到 似乎与重复的子文件夹有同样的问题,但显然我无法对 VSO 托管构建代理执行任何建议的修复。

我是不是做错了什么,或者这是新的非XAML VSO 托管构建的错误?

好的,看来答案很简单。这是 VSO build controllers

中的错误

We are actively investigating issues with TypeScript errors on Visual Studio Online hosted build service. Some customers may experience an error about “…TypeScript.4.4\tsc.exe" is invalid. This webpage gives more information of this issue: https://github.com/Microsoft/TypeScript/issues/3493 We are applying the workaround to the targets file on the VM and it will be updated in next few hours.