Azure-pipelines-tasks: dotnet build task fails for .NET Core 2 project

Created on 2 Mar 2018  路  5Comments  路  Source: microsoft/azure-pipelines-tasks

Hi, I have just started setting up a build for a dotnet Core 2 project. The project builds fine using the command line locally (dotnet build [ProjectName].csproj). But in VSTS the command fails.

My local dotnet version is 2.1.4. NuGet restore and other tasks before the dotnet build command are successful in VSTS.

I have enabled verbose logging, which throws the following error:

2018-03-02T06:22:04.6010833Z ##[error]Error: C:\Program Files\dotnet\dotnet.exe failed. spawn C:\Program Files\dotnet\dotnet.exe ENOENT
2018-03-02T06:22:04.6028662Z ##[debug]Processed: ##vso[task.issue type=error;]Error: C:\Program Files\dotnet\dotnet.exe failed. spawn C:\Program Files\dotnet\dotnet.exe ENOENT
2018-03-02T06:22:04.6029115Z ##[debug]task result: Failed
2018-03-02T06:22:04.6030026Z ##[error]Dotnet command failed with non-zero exit code on the following projects : D:a\1\s\src\VolvoLive\VolvoLive.csproj
2018-03-02T06:22:04.6030559Z ##[debug]Processed: ##vso[task.issue type=error;]Dotnet command failed with non-zero exit code on the following projects : D:a\1\s\src\VolvoLive\VolvoLive.csproj
2018-03-02T06:22:04.6031709Z ##[debug]Processed: ##vso[task.complete result=Failed;]Dotnet command failed with non-zero exit code on the following projects : D:a\1\s\src\VolvoLive\VolvoLive.csproj
2018-03-02T06:22:04.6032340Z ##[debug]rc:-4058
2018-03-02T06:22:04.6032684Z ##[debug]success:false

VSTS account name: vccsp
team project name: VolvoCarsLive
build definition name: VCL Dev Deploy CI
build number: 20180302.2
agent queue name: Hosted VS2017

Logs: logs_1736.zip

Most helpful comment

I just cleared the "Working directory" field. Before I had set it to the subfolder containing the .csproj file which was incorrect. The working directory should be the root.

All 5 comments

Solved it myself

Can you elaborate the resolution? I am too facing similar issue.

I just cleared the "Working directory" field. Before I had set it to the subfolder containing the .csproj file which was incorrect. The working directory should be the root.

Same problem. Just to elaborate on baldswede solution (which clearing this field worked), the working directory is the VSTS Build field:

image

Had the same Problem. Clearing the "Working directory" solved the problem.

Was this page helpful?
0 / 5 - 0 ratings