Build fails with "Command exited with code" without obvious errors and result codes

soloydenko's Avatar


01 Oct, 2016 04:51 AM

How do I diagnose the root cause and fix the issue with my failing build?

appveyor.yml fails somewhere around the command trying to set up .Net Core CLI and then run dotnet restore.

Build started
git clone -q --branch=appveyor C:\projects\angular2-aspnetcore
git checkout -qf d9d53c9bc838ede3311ac37bb343037def934f23
Running Install scripts
mkdir -Force ".\scripts\obtain\" | Out-Null
iex ((new-object net.webclient).DownloadString(''))
dotnet-install: Downloading
dotnet-install: Extracting zip from
dotnet-install: Adding to current process PATH: "C:\Users\appveyor\AppData\Local\Microsoft\dotnet\". Note: This change will not be visible if PowerShell was run as a child process.
dotnet-install: Installation finished
Command exited with code

Build link:
Appveyor.yml link at GitHub:

  1. 1 Posted by Ilya Finkelshte... on 04 Oct, 2016 12:38 AM

    Ilya Finkelshteyn's Avatar


    Apparently at least some of code paths (including happy path) in this script ends with exit 0. Which kills PowerShell session in which script was called.

    We will fix appveyor to tolerate this, here is the issue created -

    As a workaround you can call it this way:

    - cmd: PowerShell.exe iex ((new-object net.webclient).DownloadString(''))

    Also I want to let you know that latest .NET Core is installed on build VMs, and maybe you can avoid this step at all. If you have some specific reasons to install it yourself -- use, as I said, workaround from above.


  2. 2 Posted by soloydenko on 04 Oct, 2016 01:12 AM

    soloydenko's Avatar

    Thank you for helping out Ilya!

    I will try to avoid manual tools installation in this scenario then. It may resolve my issue and also make *.yml simpler.

  3. 3 Posted by soloydenko on 06 Oct, 2016 03:42 AM

    soloydenko's Avatar

    I am closing the issue since preinstalled dotnet cli worked for me. Thank you again for looking into it Ilya!

  4. soloydenko closed this discussion on 06 Oct, 2016 03:42 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac