TFS 2015构建无法构建.NET Core

时间:2017-02-22 16:21:00

标签: visual-studio-2015 tfs .net-core tfsbuild tfs2015

随着我们开发.NET Core应用程序,我们现在开始受到了挫折。

我们有一个解决方案/存储库,我们收集了所有.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."

我们之前正在运行dotnet restore但没有运气。我们或多或少地尝试了一切。

这里有烦人的部分和实际问题:

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

例如此命令:"C:\Program Files (x86)\MSBuild\14.0\bin\amd64\msbuild.exe" "D:\_work\11\s\core.sln" /nologo /m /nr:false /fl /flp:"logfile=D:\_work\11\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构建步骤"同样糟糕的结果。

enter image description here

编辑2:记录

2017-02-23T08:24:34.3679600Z Starting task: Build solution
2017-02-23T08:24:34.4304594Z Executing the powershell script: D:\tasks\VSBuild\1.0.16\VSBuild.ps1
2017-02-23T08:24:34.6335861Z D:\agent\worker\tools\NuGet.exe restore "D:\_work\5\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\14.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\5\s\packages'
2017-02-23T08:24:35.7960574Z Added package 'Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.4.0' to folder 'D:\_work\5\s\packages'
2017-02-23T08:24:35.8273065Z C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe "D:\_work\5\s\ServiceFabric.Frontend.sln" /nologo /m /nr:false /t:"Clean" /fl /flp:"logfile=D:\_work\5\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\5\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\5\s\ServiceFabric.Frontend.sln" (1) is building "D:\_work\5\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\5\s\Common\Log\Log.xproj" (Clean target(s)).
2017-02-23T08:24:36.2648091Z      1>Project "D:\_work\5\s\ServiceFabric.Frontend.sln" (1) is building "D:\_work\5\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\5\s\ServiceFabric\Clients\FronEnd.sfproj" (5) is building "D:\_work\5\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\1.8\tsc.exe  --noEmitOnError
2017-02-23T08:24:36.3585616Z      6>Done Building Project "D:\_work\5\s\ServiceFabric\Clients\Portal.xproj" (Clean target(s)).
2017-02-23T08:24:36.3585616Z      5>Done Building Project "D:\_work\5\s\ServiceFabric\Clients\FronEnd.sfproj" (Clean target(s)).
2017-02-23T08:24:36.3898104Z      1>Project "D:\_work\5\s\ServiceFabric.Frontend.sln" (1) is building "D:\_work\5\s\Common\Core\Core.xproj.metaproj" (8) on node 1 (Clean target(s)).
2017-02-23T08:24:36.3898104Z      8>Project "D:\_work\5\s\Common\Core\Core.xproj.metaproj" (8) is building "D:\_work\5\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\5\s\Common\Core\Core.xproj" (Clean target(s)).
2017-02-23T08:24:36.3898104Z      8>Done Building Project "D:\_work\5\s\Common\Core\Core.xproj.metaproj" (Clean target(s)).
2017-02-23T08:24:36.3898104Z      1>Done Building Project "D:\_work\5\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\14.0\bin\msbuild.exe "D:\_work\5\s\ServiceFabric.Frontend.sln" /nologo /m /nr:false /fl /flp:"logfile=D:\_work\5\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\5\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\5\s\ServiceFabric.Frontend.sln" (1) is building "D:\_work\5\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\5\s\ServiceFabric\Clients\FronEnd.sfproj" (2) is building "D:\_work\5\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\1.8\tsc.exe  --noEmitOnError
2017-02-23T08:24:36.8273147Z        CompileTypeScript:
2017-02-23T08:24:36.8273147Z          C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.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\5\s\ServiceFabric\Clients\Portal.xproj]
2017-02-23T08:24:36.8429390Z      1>Project "D:\_work\5\s\ServiceFabric.Frontend.sln" (1) is building "D:\_work\5\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\5\s\ServiceFabric\Clients\Portal.xproj" (default targets) -- FAILED.
2017-02-23T08:24:36.8429390Z      2>Done Building Project "D:\_work\5\s\ServiceFabric\Clients\FronEnd.sfproj" (default targets) -- FAILED.
2017-02-23T08:24:36.8585648Z      5>Project "D:\_work\5\s\Common\Configuration.Core\Configuration.Core.xproj" (5) is building "D:\_work\5\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\5\s\ServiceFabric.Frontend.sln" (1) is building "D:\_work\5\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\5\s\Common\Log\Log.xproj]
2017-02-23T08:24:36.9054497Z      6>Done Building Project "D:\_work\5\s\Common\Log\Log.xproj" (default targets) -- FAILED.
2017-02-23T08:24:36.9054497Z      7>Done Building Project "D:\_work\5\s\Common\Core\Core.xproj" (default targets) -- FAILED.
2017-02-23T08:24:36.9210662Z      1>Done Building Project "D:\_work\5\s\ServiceFabric.Frontend.sln" (default targets) -- FAILED.
2017-02-23T08:24:36.9210662Z Build FAILED.
2017-02-23T08:24:36.9210662Z        "D:\_work\5\s\ServiceFabric.Frontend.sln" (default target) (1) ->
2017-02-23T08:24:36.9210662Z        "D:\_work\5\s\ServiceFabric\Clients\FronEnd.sfproj" (default target) (2) ->
2017-02-23T08:24:36.9210662Z        "D:\_work\5\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\5\s\ServiceFabric\Clients\Portal.xproj]
2017-02-23T08:24:36.9210662Z        "D:\_work\5\s\ServiceFabric.Frontend.sln" (default target) (1) ->
2017-02-23T08:24:36.9210662Z        "D:\_work\5\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\5\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.

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

我们觉得基本上卡住了!

提前致谢!

2 个答案:

答案 0 :(得分:1)

这在发布后不是问题,是以某种方式连接到预览状态,不确定错误是什么。但它不再是错的:)

答案 1 :(得分:0)

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

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

基本上,只需模仿构建服务器上dev机器上命令行的操作。