Overview
When using the Windows Orb, you may need to use Visual Studio Tools. In certain build setups, you may encounter errors.
Solutions
1. Per the Windows executor page, we do know that the "Visual Studio Build Tools" is present:
What's in the Box?
Windows Server 2019 Core Datacenter Edition
Visual Studio 2019 Community Edition
Additional licensing terms may apply to your organisation when using this version of Visual Studio on CircleCI. Please review the Visual Studio 2019 Community Edition licensing terms before using this Visual Studio version in your Windows jobs.
Azure SDK for Visual Studio 2019
Visual Studio 2019 Build Tools
One solution, is that you need to call the batch script that imports the visual studio paths on Windows. Be sure that you have the shell set to cmd.exe, and you can use a command such as:
call "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
2. If you are using Node/NPM, you will need one additional setting. For Windows builds using Node, you need to set themsvs_version (See https://github.com/nodejs/node-gyp#on-windows)
Please ensure you have a step such as the following:
npm config set msvs_version 2017
Additional Resources
See information on our Windows Orb:
https://circleci.com/developer/orbs/orb/circleci/windows
Information on our Windows Executor:
https://circleci.com/docs/using-windows/https://docs.gradle.org/current/userguide/troubleshooting.html