Installing VSCode and its WSL Extension - giobim/Some-help-from-my-Friends GitHub Wiki

In Part 1, we will detailled the setup of VS Code, for developing 3-Tiers applications with Linux and in particular, for users of MS Windows OS.

Windows as a developer machine

Windows is a popular operating system but until recently it wasn't great for development of 3-Tiers Applications. Until now! Thanks to GNU/Linux and Windows features such as the Windows Subsystem for Linux (WSL) and the new Windows Terminal, it becomes a great cross-platform development environment.

Windows Terminal

It lets you easily open PowerShell, Command Prompt, and WSL bash terminals in a multiple tab shell - a clone of well-known Linux screen.

Available from the Microsoft Store, the Windows Terminal (Preview), we simply install it and close this topic for now.

Visual Studio Code

Visual Studio Code is a lightweight but powerful cross-plaform source code editor which runs on your desktop. It comes with built-in support for JavaScript, TypeScript and Node.js and has a rich ecosystem of extensions for other languages (such as C++, C#, Java, Python, PHP, Go) and runtimes (such as .NET and Unity). Begin your journey with VS Code with these introductory videos.

To get the most out of Visual Studio Code, start by reviewing a few introductory topics:

  • Why VS Code? - Read about the design philosophy and architecture of VS Code.

  • Setup - Install VS Code for your platform and configure the tool set for your development needs.

  • User Interface - Introduction to the basic UI, commands, and features of the VS Code editor.

  • Settings - Customize VS Code for how you like to work.

  • Languages - Learn about VS Code's support for your favorite programming languages.

Increase your productivity with VS Code's keyboard shortcuts:

Setup

VS Code is a free code editor which runs on the macOS, Linux and Windows operating systems.

We are detailing the Windows+WSL platform but follows the other platform specific guides below:

VS Code is lightweight and should run on most available hardware and platform versions. You can review the System Requirements to check if your computer configuration is supported.

VS Code releases a new version each month with new features and important bug fixes. Most platforms support auto updating and you will be prompted to install the new release when it becomes available. You can also manually check for updates by running Help > Check for Updates.

Note: You can disable auto-update if you prefer to update VS Code on your own schedule.

Downloads the installation package for your platform:

Download VS Code - Quickly find the appropriate install for your platform (Windows, macOS and Linux)

Note: If you are using a corporate machine you don't have the adminitration rights and you will need to choose one of the `User Installer` packages.

Installation

Recent Windows build, make sure you are on a recent Windows 10 build. Check Settings > Windows Update to see if you are up-to-date.

Once it is downloaded, run the installer (VSCodeUserSetup-{version}.exe). This will only take a minute. By default, VS Code is installed under C:\Users\{username}\AppData\Local\Programs\Microsoft VS Code.

Alternatively, you can also download a Zip archive, extract it and run Code from there.

Note: .NET Framework 4.5.2 or higher is required for VS Code. If you are using Windows 7, make sure you have at least .NET Framework 4.5.2 installed.

Tip: Setup will add Visual Studio Code to your %PATH%, so from the console you can type 'code .' to open VS Code on that folder. You will need to restart your console after the installation for the change to the %PATH% environmental variable to take effect.

Once you have installed VS Code, we install additional components like Remote-WSL, Git, Python and IntelliCode.

Remote-WSL Extension

With WSL, you can install and run Linux distributions on Windows. This enables you to develop and test your source code on Linux while still working locally on your Windows machine.

When coupled with the Remote - WSL extension, you get full VS Code editing and debugging support while running in the context of WSL.

Here I walk you through enabling Windows Subsystem for Linux (WSL) and running Visual Studio Code in WSL using the Remote - WSL extension. Prerequisites

You need Visual Studio Code installed and click the link: Install the Remote - WSL extension

Install Dialog for WSL-Remote

Fig. 1 WSL-Remote Install Dialog

Prerequisite check: with the Remote - WSL extension installed, you will see a new Status bar item at the far left.

Prerequisite check Status bar

Fig. 2 Prerequisite check Status bar

The Remote Status bar item can quickly show you in which context VS Code is running (local or remote) and clicking on the item will bring up the Remote - WSL commands.

WSL-Remote Commands Dialog

Fig. 4 WSL-Remote Commands Dialog

That's all Folks!