Set Up Your Environment

📖 Instructions#

Before writing any code, you need a place to write it. Programmers write code in an Integrated Development Environment (IDE) — a single application that lets you write, organise, and run computer programs.

In this lesson you’ll install Visual Studio Code (VS Code), a free, lightweight IDE that works with almost any programming language. You’ll also install C# Dev Kit, the extension that gives VS Code full C# support — including error detection, autocomplete, and the ability to run your programs.

🎓 Learn More

✅ What to Do#

Install Visual Studio Code and the C# Dev Kit extension.

  1. Download and install Visual Studio Code (external link).
  2. Open Visual Studio Code.
  3. Open the Extensions panel by clicking the extensions icon in the left sidebar.
  4. Search for C# Dev Kit and click Install.
  5. Wait for the installation to complete — VS Code may prompt you to reload, click Reload if it does.

🎯 Expected Outcome#

VS Code is open and the C# Dev Kit extension is installed. In the Extensions panel, C# Dev Kit should show as Installed with no errors.

Open the built-in terminal (View → Terminal) and run:

dotnet --version

You should see a version number printed:

9.0.101

If you see a version number, your environment is ready.

💡 Hints#

Hint 1

The Extensions panel has its own icon in the left sidebar. Look for the one that looks like four squares.

Hint 2

There are several extensions with “C#” in the name. Look carefully at the publisher — the one you want is published by Microsoft.

Hint 3

If dotnet --version shows command not found or similar, the .NET SDK might still be installing in the background. Close VS Code completely and reopen it before trying again.

⚠️ Common Mistakes#

Installing the wrong extension

Searching for “C#” returns several extensions. The one you want is C# Dev Kit by Microsoft — not the standalone C# extension, and not any third-party alternative. C# Dev Kit bundles everything you need, including the .NET SDK.

Not waiting for the installation to finish

C# Dev Kit installs the .NET SDK in the background after the extension itself is installed. If you open the terminal too quickly and dotnet --version fails, wait a minute and try again. If it still fails, close and reopen VS Code so the terminal picks up the newly installed SDK.

Running dotnet --version in the wrong place

The command must be run in the VS Code built-in terminal, not in the search bar or the Command Palette. Open the terminal from View → Terminal in the menu.

🙈 Solution#

Tried, you must, before reveal the solution you may.

There is no code solution for this step — the outcome is a working environment, not a program.

If dotnet --version prints a version number in the terminal, you’re done.