Visual Studio not visible: Cannot find vswhere.exe
I'm trying to build with react-native-windows
but the CLI is unable to find the Visual Studio installation included in the container.
Looking for vswhere at: C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe
- Could not find MSBuild with VCTools for Visual Studio 16.7 or later. Make sure all required components have been installed
✖ Could not find MSBuild with VCTools for Visual Studio 16.7 or later. Make sure all required components have been installed
I've tried including the installation in the PATH, as outlined in this post, but it results in the same output.
Config file:
.shared_windows_runners:
tags:
- shared-windows
- windows
- windows-1809
stages:
- build
.deploy:
stage: deploy
artifacts:
# gitlab runner cannot expand sub commands so we have to redefine the artifacts name
name: '${CI_PROJECT_NAME}-${CI_COMMIT_REF_SLUG}-${CI_JOB_NAME}'
paths:
- '*.ipa'
- '*.app'
- '*.apk'
- '*.aab'
- '*.exe'
expire_in: 1 week
build_windows:
extends:
- .shared_windows_runners
- .deploy
stage: build
before_script:
- start powershell
- cd application
script:
- choco install nodejs --version 14.20.0 -y --no-progress
- npm ci
- $Env:Path += ";C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin"
- npx react-native run-windows --arch x64 --release --logging