TFS 2015 构建无法构建 .NET Core

TFS 2015 build can't build .NET Core

我们现在真的开始对 .NET Core 应用程序的开发感到沮丧。

我们有一个 solution/repository,我们收集了所有的 .NET 核心项目,它在 Visual Studio 2015 年内在本地构建时运行良好,但是一旦我们尝试设置 CI 构建和其他构建都失败了。

我们总是回到的错误是臭名昭著的 "GETSDKTOOLINGINFO(0,0): Error : The project is configured to use .NET Core SDK version 1.0.0-preview2-1-003177 which is not installed or cannot be found."

我们之前 运行ning dotnet restore 运气不好。我们或多或少都尝试过。

恼人的部分来了,真正的问题是:

如果我们复制构建命令并 运行 在正常的命令提示符下在本地构建代理服务器上它工作得很好,没有错误

例如这个命令:"C:\Program Files (x86)\MSBuild.0\bin\amd64\msbuild.exe" "D:\_work\s\core.sln" /nologo /m /nr:false /fl /flp:"logfile=D:\_work\s\core.sln.log" /dl:CentralLogger,"D:\agent\worker\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"*ForwardingLogger,"D:\agent\worker\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"

不要完成 TFS 构建。

该命令在构建代理计算机上本地运行。

编辑 1:屏幕下方显示我们没有使用任何特殊的构建步骤。我们已更改为 "msbuild build step",结果同样糟糕。

编辑 2:日志

2017-02-23T08:24:34.3679600Z Starting task: Build solution
2017-02-23T08:24:34.4304594Z Executing the powershell script: D:\tasks\VSBuild.0.16\VSBuild.ps1
2017-02-23T08:24:34.6335861Z D:\agent\worker\tools\NuGet.exe restore "D:\_work\s\ServiceFabric.Frontend.sln" -NonInteractive
2017-02-23T08:24:35.0085872Z MSBuild auto-detection: using msbuild version '14.0' from 'C:\Program Files (x86)\MSBuild.0\bin'.
2017-02-23T08:24:35.1335875Z Restoring NuGet package Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.4.0.
2017-02-23T08:24:35.4054303Z Adding package 'Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.4.0' to folder 'D:\_work\s\packages'
2017-02-23T08:24:35.7960574Z Added package 'Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.4.0' to folder 'D:\_work\s\packages'
2017-02-23T08:24:35.8273065Z C:\Program Files (x86)\MSBuild.0\bin\msbuild.exe "D:\_work\s\ServiceFabric.Frontend.sln" /nologo /m /nr:false /t:"Clean" /fl /flp:"logfile=D:\_work\s\ServiceFabric.Frontend.sln-clean.log" /dl:CentralLogger,"D:\agent\worker\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"*ForwardingLogger,"D:\agent\worker\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"  /p:platform="x64" /p:configuration="release" /p:VisualStudioVersion="14.0"
2017-02-23T08:24:35.9210571Z Build started 2017-02-23 09:24:35.
2017-02-23T08:24:35.9523075Z      1>Project "D:\_work\s\ServiceFabric.Frontend.sln" on node 1 (Clean target(s)).
2017-02-23T08:24:35.9523075Z      1>ValidateSolutionConfiguration:
2017-02-23T08:24:35.9523075Z          Building solution configuration "release|x64".
2017-02-23T08:24:36.0148080Z      1>Project "D:\_work\s\ServiceFabric.Frontend.sln" (1) is building "D:\_work\s\Common\Log\Log.xproj" (2) on node 1 (Clean target(s)).
2017-02-23T08:24:36.0148080Z      2>CoreClean:
2017-02-23T08:24:36.0148080Z          Creating directory ".\obj\Release\".
2017-02-23T08:24:36.0148080Z      2>Done Building Project "D:\_work\s\Common\Log\Log.xproj" (Clean target(s)).
2017-02-23T08:24:36.2648091Z      1>Project "D:\_work\s\ServiceFabric.Frontend.sln" (1) is building "D:\_work\s\ServiceFabric\Clients\FronEnd.sfproj" (5) on node 4 (Clean target(s)).
2017-02-23T08:24:36.2648091Z      5>CoreClean:
2017-02-23T08:24:36.2648091Z          Creating directory "obj\x64\Release\".
2017-02-23T08:24:36.3116863Z      5>Project "D:\_work\s\ServiceFabric\Clients\FronEnd.sfproj" (5) is building "D:\_work\s\ServiceFabric\Clients\Portal.xproj" (6) on node 1 (Clean target(s)).
2017-02-23T08:24:36.3116863Z      6>CoreClean:
2017-02-23T08:24:36.3116863Z          Creating directory ".\obj\Release\".
2017-02-23T08:24:36.3585616Z        PreComputeCompileTypeScript:
2017-02-23T08:24:36.3585616Z          C:\Program Files (x86)\Microsoft SDKs\TypeScript.8\tsc.exe  --noEmitOnError
2017-02-23T08:24:36.3585616Z      6>Done Building Project "D:\_work\s\ServiceFabric\Clients\Portal.xproj" (Clean target(s)).
2017-02-23T08:24:36.3585616Z      5>Done Building Project "D:\_work\s\ServiceFabric\Clients\FronEnd.sfproj" (Clean target(s)).
2017-02-23T08:24:36.3898104Z      1>Project "D:\_work\s\ServiceFabric.Frontend.sln" (1) is building "D:\_work\s\Common\Core\Core.xproj.metaproj" (8) on node 1 (Clean target(s)).
2017-02-23T08:24:36.3898104Z      8>Project "D:\_work\s\Common\Core\Core.xproj.metaproj" (8) is building "D:\_work\s\Common\Core\Core.xproj" (9) on node 2 (Clean target(s)).
2017-02-23T08:24:36.3898104Z      9>CoreClean:
2017-02-23T08:24:36.3898104Z          Creating directory ".\obj\Release\".
2017-02-23T08:24:36.3898104Z      9>Done Building Project "D:\_work\s\Common\Core\Core.xproj" (Clean target(s)).
2017-02-23T08:24:36.3898104Z      8>Done Building Project "D:\_work\s\Common\Core\Core.xproj.metaproj" (Clean target(s)).
2017-02-23T08:24:36.3898104Z      1>Done Building Project "D:\_work\s\ServiceFabric.Frontend.sln" (Clean target(s)).
2017-02-23T08:24:36.3898104Z Build succeeded.
2017-02-23T08:24:36.3898104Z     0 Warning(s)
2017-02-23T08:24:36.3898104Z     0 Error(s)
2017-02-23T08:24:36.3898104Z Time Elapsed 00:00:00.46
2017-02-23T08:24:36.4054367Z C:\Program Files (x86)\MSBuild.0\bin\msbuild.exe "D:\_work\s\ServiceFabric.Frontend.sln" /nologo /m /nr:false /fl /flp:"logfile=D:\_work\s\ServiceFabric.Frontend.sln.log" /dl:CentralLogger,"D:\agent\worker\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"*ForwardingLogger,"D:\agent\worker\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"  /p:platform="x64" /p:configuration="release" /p:VisualStudioVersion="14.0"
2017-02-23T08:24:36.4835619Z Build started 2017-02-23 09:24:36.
2017-02-23T08:24:36.4991873Z      1>Project "D:\_work\s\ServiceFabric.Frontend.sln" on node 1 (default targets).
2017-02-23T08:24:36.4991873Z      1>ValidateSolutionConfiguration:
2017-02-23T08:24:36.4991873Z          Building solution configuration "release|x64".
2017-02-23T08:24:36.5460612Z      1>Project "D:\_work\s\ServiceFabric.Frontend.sln" (1) is building "D:\_work\s\ServiceFabric\Clients\FronEnd.sfproj" (2) on node 1 (default targets).
2017-02-23T08:24:36.5460612Z      2>PrepareForBuild:
2017-02-23T08:24:36.5460612Z          Creating directory "bin\Release\".
2017-02-23T08:24:36.8273147Z      2>Project "D:\_work\s\ServiceFabric\Clients\FronEnd.sfproj" (2) is building "D:\_work\s\ServiceFabric\Clients\Portal.xproj" (3) on node 1 (default targets).
2017-02-23T08:24:36.8273147Z      3>PrepareForBuild:
2017-02-23T08:24:36.8273147Z          Creating directory ".\bin\".
2017-02-23T08:24:36.8273147Z        PreComputeCompileTypeScript:
2017-02-23T08:24:36.8273147Z          C:\Program Files (x86)\Microsoft SDKs\TypeScript.8\tsc.exe  --noEmitOnError
2017-02-23T08:24:36.8273147Z        CompileTypeScript:
2017-02-23T08:24:36.8273147Z          C:\Program Files (x86)\Microsoft SDKs\TypeScript.8\tsc.exe  --noEmitOnError
2017-02-23T08:24:36.8429390Z ##[error]GETSDKTOOLINGINFO(0,0): Error : The .NET Core SDK is not installed or cannot be found. These components are required to build and run this project.
2017-02-23T08:24:36.8429390Z      3>GETSDKTOOLINGINFO : error : The .NET Core SDK is not installed or cannot be found. These components are required to build and run this project. [D:\_work\s\ServiceFabric\Clients\Portal.xproj]
2017-02-23T08:24:36.8429390Z      1>Project "D:\_work\s\ServiceFabric.Frontend.sln" (1) is building "D:\_work\s\Common\Configuration.Core\Configuration.Core.xproj" (5) on node 2 (default targets).
2017-02-23T08:24:36.8429390Z      5>PrepareForBuild:
2017-02-23T08:24:36.8429390Z          Creating directory ".\bin\".
2017-02-23T08:24:36.8429390Z      3>Done Building Project "D:\_work\s\ServiceFabric\Clients\Portal.xproj" (default targets) -- FAILED.
2017-02-23T08:24:36.8429390Z      2>Done Building Project "D:\_work\s\ServiceFabric\Clients\FronEnd.sfproj" (default targets) -- FAILED.
2017-02-23T08:24:36.8585648Z      5>Project "D:\_work\s\Common\Configuration.Core\Configuration.Core.xproj" (5) is building "D:\_work\s\Common\Core\Core.xproj" (7) on node 2 (default targets).
2017-02-23T08:24:36.8585648Z      7>PrepareForBuild:
2017-02-23T08:24:36.8585648Z          Creating directory ".\bin\".
2017-02-23T08:24:36.8898141Z      1>Project "D:\_work\s\ServiceFabric.Frontend.sln" (1) is building "D:\_work\s\Common\Log\Log.xproj" (6) on node 4 (default targets).
2017-02-23T08:24:36.8898141Z      6>PrepareForBuild:
2017-02-23T08:24:36.8898141Z          Creating directory ".\bin\".
2017-02-23T08:24:36.9054497Z ##[error]GETSDKTOOLINGINFO(0,0): Error : The .NET Core SDK is not installed or cannot be found. These components are required to build and run this project.
2017-02-23T08:24:36.9054497Z      6>GETSDKTOOLINGINFO : error : The .NET Core SDK is not installed or cannot be found. These components are required to build and run this project. [D:\_work\s\Common\Log\Log.xproj]
2017-02-23T08:24:36.9054497Z      6>Done Building Project "D:\_work\s\Common\Log\Log.xproj" (default targets) -- FAILED.
2017-02-23T08:24:36.9054497Z      7>Done Building Project "D:\_work\s\Common\Core\Core.xproj" (default targets) -- FAILED.
2017-02-23T08:24:36.9210662Z      1>Done Building Project "D:\_work\s\ServiceFabric.Frontend.sln" (default targets) -- FAILED.
2017-02-23T08:24:36.9210662Z Build FAILED.
2017-02-23T08:24:36.9210662Z        "D:\_work\s\ServiceFabric.Frontend.sln" (default target) (1) ->
2017-02-23T08:24:36.9210662Z        "D:\_work\s\ServiceFabric\Clients\FronEnd.sfproj" (default target) (2) ->
2017-02-23T08:24:36.9210662Z        "D:\_work\s\ServiceFabric\Clients\Portal.xproj" (default target) (3) ->
2017-02-23T08:24:36.9210662Z        (GetSDKToolingInfoTarget target) -> 
2017-02-23T08:24:36.9210662Z          GETSDKTOOLINGINFO : error : The .NET Core SDK is not installed or cannot be found. These components are required to build and run this project. [D:\_work\s\ServiceFabric\Clients\Portal.xproj]
2017-02-23T08:24:36.9210662Z        "D:\_work\s\ServiceFabric.Frontend.sln" (default target) (1) ->
2017-02-23T08:24:36.9210662Z        "D:\_work\s\Common\Log\Log.xproj" (default target) (6) ->
2017-02-23T08:24:36.9210662Z          GETSDKTOOLINGINFO : error : The .NET Core SDK is not installed or cannot be found. These components are required to build and run this project. [D:\_work\s\Common\Log\Log.xproj]
2017-02-23T08:24:36.9210662Z     0 Warning(s)
2017-02-23T08:24:36.9210662Z     2 Error(s)
2017-02-23T08:24:36.9210662Z Time Elapsed 00:00:00.43
2017-02-23T08:24:36.9366903Z ##[error]Unexpected exit code received from msbuild.exe: 1
2017-02-23T08:24:36.9679398Z Finishing task: VSBuild
2017-02-23T08:24:36.9835654Z ##[error]Task VSBuild failed. This caused the job to fail. Look at the logs for the task for more details.

有人遇到过这个问题并通过了吗?

感觉基本卡住了!

提前致谢!

在 Team Foundation Server (TFS) 生成定义中,添加命令行生成步骤以恢复、生成、测试、打包和发布例程。 (它们将是单独的构建步骤,并且每个 VS 项目都需要测试、打包和发布)。

这当然假定您在 TFS Build Agents 上安装了 dotnet cli 工具。

基本上,只需在构建服务器上的开发机器上模拟您在命令行中执行的操作即可。

这不是发布后的问题,是通过某种方式连接到预览状态的,不确定具体是哪里出了问题。但它不再错了:)