No valid MSBuild was detected for the selected target

Guillermo Martinez Espina's Avatar

Guillermo Martinez Espina

03 Jul, 2019 06:51 PM

While running my cordova project I get the following error,

1452No valid MSBuild was detected for the selected target: Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe: Command failed with exit code 1

I noticed that Appveyor is using Visual Sutdio v2015, even having Visual Studio 2017 in my .appveyor.yml file set like this,

image:
  - Visual Studio 2017

I also have on settings/environment/Build worker image set to Visual Studio 2017.

I wonder if my problem has something to do with not having Visual Studio 2017 installed?

Here is my .appveyor.yml configuration,

max_jobs: 1

shallow_clone: true

environment:
  nodejs_version: "10"

platform:
  - x64

configuration:
  - Debug

init:
  - git config --global core.autocrlf true
  - sh: curl -sflL 'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-ssh.sh' | bash -e -
  - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

image:
  - Visual Studio 2017

install:
  - ps: Install-Product node $env:nodejs_version x64
    # install modules
  - node --version
  - npm install -g cordova@8.1.2
  - npm install -g shasum
  - npm install shelljs
  - npm install -f

build_script:
  - ps: scripts/ci/build_mobile.ps1

artifacts:
  - path: \zenput\static\phonegap\platforms\windows\AppPackages\
    name: Windows App

on_finish:
  - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

cache:
  - node_modules -> appveyor.yml,package.json
  1. Support Staff 1 Posted by Feodor Fitsner on 04 Jul, 2019 04:06 AM

    Feodor Fitsner's Avatar

    In fact, Visual Studio 2017 image has both VS 2015 and VS 2017 installed. Could it be an issue for that detection algorithm?

  2. 2 Posted by Guillermo Marti... on 08 Jul, 2019 04:45 PM

    Guillermo Martinez Espina's Avatar

    I don't think that our script build_mobile.ps1 has something to do with this, because the only thing we do in that script is to check whether our commit has changes on our mobile base and if that's the case we run npx cordova build windows and that's when it breaks.

  3. Support Staff 3 Posted by Ilya Finkelshte... on 08 Jul, 2019 06:13 PM

    Ilya Finkelshteyn's Avatar

    Is there any way you can provide a repro in public repository?

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? 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