Building Console App Using Visual Studio Code
Explore how to set up Visual Studio Code for cross-platform .NET development and build your first console application using the dotnet command-line interface. Learn to manage multiple projects with workspaces, handle dependencies, and customize your code efficiently across Windows, macOS, and Linux systems.
We'll cover the following...
This lesson aims to showcase how to build a console app using Visual Studio Code and the dotnet command-line interface (CLI). If you never want to try Visual Studio Code or .NET Interactive Notebooks, please feel free to skip this section and the next and then continue.
The instructions and screenshots in this lesson are for Windows, but the same actions will work with Visual Studio Code on the macOS and Linux variants.
The main differences will be native command-line actions such as deleting a file: both the command and the path will likely differ on Windows or macOS and Linux. Luckily, the dotnet CLI tool is identical on all platforms.
Managing multiple projects using Visual Studio Code
Visual Studio Code has a concept named a workspace that allows us to open and manage multiple projects simultaneously. We will use a workspace to manage the two projects we create. Let’s get started writing code!
Step 1: Start Visual Studio Code.
Step 2: Make sure we have no open files, folders, or workspaces.
Step 3: Navigate to “File | Save Workspace As…” option.
...