buildazure-devops

Dotnet command failed with non-zero exit code on the following projects


I have set up a build definition on VSTS. It builds fine on my local machine. But I get the following error when I start the build process

[error]Dotnet command failed with non-zero exit code on the following projects : D:\a\1\s\My.Project\My.Project.csproj


Solution

  • Check the project name in the error carefully. Chances are its not actually in your solution .sln ... and wouldn't build if it were. By default, VSTS will try to build all .csproj files regardless whether they are in your solution or not. Remove all .csproj files for projects you don't want to be built.

    In my case. I deleted the \My.Project directory (which contained the .csproj file) and the build suceeded.