typescript - VSO ASP.NET5 CI 构建期间出错 - "Your project uses a different version of the TypeScript compiler"但我没有使用 TypeScript

标签 typescript visual-studio-2015 continuous-integration asp.net-core azure-devops

从昨天(2015 年 8 月 31 日)开始,在运行持续集成构建时,我的 Visual Studio Online 构建服务器突然出现错误。错误发生在我的 DNX 项目 (Build Foo.Api.xproj) 的构建步骤中,文本如下:

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\1.4\1.4\tsc.exe. You may be able to fix this problem by changing the element in your project file.

问题是,我根本没有在项目中使用 TypeScript 并且 Find 没有任何结果。我和我的同事核实过,他们似乎在持续集成构建中遇到了类似的错误,包括在一个根本没有更改的项目中。

这让我相信这是 VSO 构建服务器的问题,也许是升级。有谁知道这里发生了什么以及如何解决它?

为了提供一些上下文,这是此步骤在构建控制台上的完整输出:

    Executing the powershell script: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\tasks\VSBuild\1.0.13\VSBuild.ps1
C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe "C:\a\12345678\Root\src\Foo.Api\Foo.Api.xproj" /nologo /m /nr:false /fl /flp:"logfile=C:\a\12345678\Root\src\Foo.Api\Foo.Api.xproj.log" /dl:CentralLogger,"C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agent\worker\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"*ForwardingLogger,"C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agent\worker\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /t:Build,FileSystemPublish /p:PublishConfiguration=Release /p:PublishOutputPathNoTrailingSlash=C:\a\12345678\staging/Foo.Api /p:platform="any cpu" /p:configuration="Release" /p:VisualStudioVersion="14.0"
Build started 9/1/2015 6:36:28 AM.
The target "AfterGenerateAppxManifest" listed in an AfterTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\Microsoft.Net.CoreRuntime.targets (68,11)" does not exist in the project, and will be ignored.
The target "_GeneratePrisForPortableLibraries" listed in a BeforeTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\Microsoft.Net.CoreRuntime.targets (177,11)" does not exist in the project, and will be ignored.
The target "AfterGenerateAppxManifest" listed in an AfterTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\Microsoft.NetNative.targets (126,11)" does not exist in the project, and will be ignored.
The target "AfterGenerateAppxManifest" listed in an AfterTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\Microsoft.NetNative.targets (174,11)" does not exist in the project, and will be ignored.
The target "BeforeGenerateProjectPriFile" listed in a BeforeTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft\NuGet\Microsoft.NuGet.targets (149,61)" does not exist in the project, and will be ignored.
     1>Project "C:\a\12345678\Root\src\Foo.Api\Foo.Api.xproj" on node 1 (Build;FileSystemPublish target(s)).
     1>PrepareForBuild:
         Creating directory "..\artifacts\bin\Foo.Api\".
         Creating directory "..\artifacts\obj\Foo.Api\any cpu\Release\".
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript\Microsoft.TypeScript.targets(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\1.4\1.4\tsc.exe. You may be able to fix this problem by changing the <TypeScriptToolsVersion> element in your project file.
     1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript\Microsoft.TypeScript.targets(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\1.4\1.4\tsc.exe.  You may be able to fix this problem by changing the <TypeScriptToolsVersion> element in your project file. [C:\a\12345678\Root\src\Foo.Api\Foo.Api.xproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript\Microsoft.TypeScript.targets(103,5): Error MSB6004: The specified task executable location "C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.4\1.4\tsc.exe" is invalid.
     1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript\Microsoft.TypeScript.targets(103,5): error MSB6004: The specified task executable location "C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.4\1.4\tsc.exe" is invalid. [C:\a\12345678\Root\src\Foo.Api\Foo.Api.xproj]
     1>Done Building Project "C:\a\12345678\Root\src\Foo.Api\Foo.Api.xproj" (Build;FileSystemPublish target(s)) -- FAILED.
Build FAILED.
       "C:\a\12345678\Root\src\Foo.Api\Foo.Api.xproj" (Build;FileSystemPublish target) (1) ->
       (PreComputeCompileTypeScript target) -> 
         C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript\Microsoft.TypeScript.targets(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\1.4\1.4\tsc.exe.  You may be able to fix this problem by changing the <TypeScriptToolsVersion> element in your project file. [C:\a\12345678\Root\src\Foo.Api\Foo.Api.xproj]
         C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript\Microsoft.TypeScript.targets(103,5): error MSB6004: The specified task executable location "C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.4\1.4\tsc.exe" is invalid. [C:\a\12345678\Root\src\Foo.Api\Foo.Api.xproj]
    0 Warning(s)
    2 Error(s)
Time Elapsed 00:00:01.81

最佳答案

在 MSDN(下面的链接)上发布了一个解决方法。它对我有用!基本上,您将以下内容添加到构建定义的 MSBuild Arguments 部分:

/p:TscToolExe="..\tsc.exe"

所以现在我的构建定义如下所示:

"Build" tab of build definition for "Visual Studio Build" step

我还在 GitHub 上打开了一个新问题,但我得到的回复是这不是 TypeScript 的问题,而是 Visual Studio Online 的问题,并且 VSO 团队知道并正在修复。希望这对您有所帮助!

promise 引用:https://social.msdn.microsoft.com/Forums/en-US/c6443c18-23d7-4bd2-a0f9-1fa558f18d22/typescript-build-failing-for-visual-studio-online-hosted-build-controller-due-to-typescript?forum=TFService

关于typescript - VSO ASP.NET5 CI 构建期间出错 - "Your project uses a different version of the TypeScript compiler"但我没有使用 TypeScript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32325894/

相关文章:

visual-studio-2015 - Visual Studio 2015 调试器损坏 - 是错误还是只是我?

c# - 当我尝试使用 ANTLR4 生成 C# 时出现的这些奇怪错误是什么?

c# - 为解决方案生成 nuspec 文件?

msbuild - Team City 7 在项目中找不到 DLL

reactjs - 如何在 React 中获取 ChildNode 的宽度?

c++ - Visual Studio 2015无法产生在Windows XP上成功注册的ATL Dll

javascript - 如何将图像添加到expo中的android可绘制资源而不运行expo prebuild来创建android文件夹

maven - Intellij代码检查Maven插件

angular - 如何在 Ionic2 中单击时更改按钮颜色?

css - 有没有办法让垫卡内的内容保持响应?