Modify launch.json and tasks.json of your project's .vscode directory so you can debug your code within the editor.
Launch a shell with the build environment you want (for example):
- Developer Command Prompt for VS 2019
- x86 Native Tools Command Prompt for VS 2019
- x64 Native Tools Command Prompt for VS 2019
Change the current directory to your project and run visual studio code from there
$ code .
Visual Studio Code will execute the build task in it's own shell inheriting from the environment of the shell it was launched from.