0
votes

I defined a VSTS task: enter image description here

and I'm getting an error:

2017-11-09T21:25:07.8842340Z ##[section]Starting: Publish copy 2017-11-09T21:25:07.8969280Z ============================================================================== 2017-11-09T21:25:07.9036290Z Task : .NET Core 2017-11-09T21:25:07.9066480Z Description : Build, test, package, or publish a dotnet application, or run a custom dotnet command. For package commands, supports NuGet.org and authenticated feeds like Package Management and MyGet. 2017-11-09T21:25:07.9092700Z Version : 2.1.8 2017-11-09T21:25:07.9122030Z Author : Microsoft Corporation 2017-11-09T21:25:07.9153020Z Help : More Information 2017-11-09T21:25:07.9181040Z ============================================================================== 2017-11-09T21:25:10.3802130Z [command]/opt/vsts/work/_tool/dncs/2.0.0/x64/dotnet publish /opt/vsts/work/1/s/Api/Api.csproj --configuration $(BuildConfiguration) --output .\obj\Docker\publish 2017-11-09T21:25:13.3290490Z Microsoft (R) Build Engine version 15.3.409.57025 for .NET Core 2017-11-09T21:25:13.3323650Z Copyright (C) Microsoft Corporation. All rights reserved. 2017-11-09T21:25:13.3347770Z 2017-11-09T21:25:20.3979410Z Core -> /opt/vsts/work/1/s/Core/bin/$(BuildConfiguration)/netcoreapp2.0/Core.dll 2017-11-09T21:25:25.7586100Z Infrastructure -> /opt/vsts/work/1/s/Infrastructure/bin/$(BuildConfiguration)/netcoreapp2.0/Infrastructure.dll 2017-11-09T21:25:29.5066330Z Api -> /opt/vsts/work/1/s/Api/bin/$(BuildConfiguration)/netcoreapp2.0/Api.dll 2017-11-09T21:25:29.6098500Z /bin/sh: 2: /opt/vsts/work/_temp/tmpbae052718c06412094faac10781aa78e.exec.cmd: BuildConfiguration: not found 2017-11-09T21:25:29.6143540Z /bin/sh: 2: /opt/vsts/work/_temp/tmpbae052718c06412094faac10781aa78e.exec.cmd: BuildConfiguration: not found 2017-11-09T21:25:29.6211710Z /bin/sh: 2: /opt/vsts/work/_temp/tmpbae052718c06412094faac10781aa78e.exec.cmd: BuildConfiguration: not found 2017-11-09T21:25:29.6241270Z The specified deps.json [/opt/vsts/work/1/s/Api/bin//netcoreapp2.0/Api.deps.json] does not exist 2017-11-09T21:25:29.6291470Z /opt/vsts/work/_tool/dncs/2.0.0/x64/sdk/NuGetFallbackFolder/microsoft.aspnetcore.mvc.razor.viewcompilation/2.0.0/build/netstandard2.0/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.targets(60,5): error MSB3073: The command ""/opt/vsts/work/_tool/dncs/2.0.0/x64/dotnet" exec --runtimeconfig "/opt/vsts/work/1/s/Api/bin/$(BuildConfiguration)/netcoreapp2.0/Api.runtimeconfig.json" --depsfile "/opt/vsts/work/1/s/Api/bin/$(BuildConfiguration)/netcoreapp2.0/Api.deps.json" "/opt/vsts/work/_tool/dncs/2.0.0/x64/sdk/NuGetFallbackFolder/microsoft.aspnetcore.mvc.razor.viewcompilation/2.0.0/build/netstandard2.0/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.dll" @"obj/$(BuildConfiguration)/netcoreapp2.0/microsoft.aspnetcore.mvc.razor.viewcompilation.rsp"" exited with code 129. [/opt/vsts/work/1/s/Api/Api.csproj] 2017-11-09T21:25:29.8180470Z ##[error]Error: /opt/vsts/work/_tool/dncs/2.0.0/x64/dotnet failed with return code: 1 2017-11-09T21:25:29.8479220Z [command]/opt/vsts/work/_tool/dncs/2.0.0/x64/dotnet publish /opt/vsts/work/1/s/Core/Core.csproj --configuration $(BuildConfiguration) --output .\obj\Docker\publish 2017-11-09T21:25:32.4096960Z Microsoft (R) Build Engine version 15.3.409.57025 for .NET Core 2017-11-09T21:25:32.4130000Z Copyright (C) Microsoft Corporation. All rights reserved. 2017-11-09T21:25:32.4144900Z 2017-11-09T21:25:36.5861200Z Core -> /opt/vsts/work/1/s/Core/bin/$(BuildConfiguration)/netcoreapp2.0/Core.dll 2017-11-09T21:25:37.0659300Z Core -> /opt/vsts/work/1/s/Core/obj/Docker/publish/ 2017-11-09T21:25:37.2400410Z [command]/opt/vsts/work/_tool/dncs/2.0.0/x64/dotnet publish /opt/vsts/work/1/s/Infrastructure/Infrastructure.csproj --configuration $(BuildConfiguration) --output .\obj\Docker\publish 2017-11-09T21:25:41.0598300Z Microsoft (R) Build Engine version 15.3.409.57025 for .NET Core 2017-11-09T21:25:41.0623670Z Copyright (C) Microsoft Corporation. All rights reserved. 2017-11-09T21:25:41.0638670Z 2017-11-09T21:25:44.2113060Z Core -> /opt/vsts/work/1/s/Core/bin/$(BuildConfiguration)/netcoreapp2.0/Core.dll 2017-11-09T21:25:46.3659950Z Infrastructure -> /opt/vsts/work/1/s/Infrastructure/bin/$(BuildConfiguration)/netcoreapp2.0/Infrastructure.dll 2017-11-09T21:25:46.8807460Z Infrastructure -> /opt/vsts/work/1/s/Infrastructure/obj/Docker/publish/ 2017-11-09T21:25:47.0068230Z [command]/opt/vsts/work/_tool/dncs/2.0.0/x64/dotnet publish /opt/vsts/work/1/s/UnitTests/UnitTests.csproj --configuration $(BuildConfiguration) --output .\obj\Docker\publish 2017-11-09T21:25:53.3168330Z Microsoft (R) Build Engine version 15.3.409.57025 for .NET Core 2017-11-09T21:25:53.3196560Z Copyright (C) Microsoft Corporation. All rights reserved. 2017-11-09T21:25:53.3212230Z 2017-11-09T21:26:06.3861780Z Core -> /opt/vsts/work/1/s/Core/bin/$(BuildConfiguration)/netcoreapp2.0/Core.dll 2017-11-09T21:26:08.8367810Z Infrastructure -> /opt/vsts/work/1/s/Infrastructure/bin/$(BuildConfiguration)/netcoreapp2.0/Infrastructure.dll 2017-11-09T21:26:14.1992030Z Api -> /opt/vsts/work/1/s/Api/bin/$(BuildConfiguration)/netcoreapp2.0/Api.dll 2017-11-09T21:26:20.5782420Z UnitTests -> /opt/vsts/work/1/s/UnitTests/bin/$(BuildConfiguration)/netcoreapp2.0/UnitTests.dll 2017-11-09T21:26:21.4168980Z UnitTests -> /opt/vsts/work/1/s/UnitTests/obj/Docker/publish/ 2017-11-09T21:26:21.5707390Z ##[error]Dotnet command failed with non-zero exit code on the following projects : /opt/vsts/work/1/s/Api/Api.csproj 2017-11-09T21:26:21.5945250Z ##[section]Finishing: Publish copy

Do you havy any idea what is wrong?

1

1 Answers

0
votes

The issue mainly caused by the variable $(BuildConfiguration) which you didn't defined in your VSTS build definition.

So you can add the variable BuildConfiguration with the value as release or debug in Variables Tab of the build definition, then queue the build again.

enter image description here