Setting Up Visual Studio
Why this matters: This is the lesson where many beginners give up. Not because programming is hard, but because the setup feels overwhelming. Stay with it. The 30 to 60 minutes you spend here pays you back for the rest of the course (and the rest of your career).
Pick the right tool for your situation
There are three serious options for writing C#. None of them is "wrong", but one of them will suit you better than the others.
| If this sounds like you... | Use this | Why |
|---|---|---|
| Windows machine with at least 8GB RAM and decent download cap | Visual Studio 2022 Community | The flagship. Best debugging experience in the industry. Free for students and individuals. |
| Older laptop, low spec, or you switch between Windows, Mac and Linux | Visual Studio Code + .NET SDK | Lighter, faster startup, identical language support, much smaller download. |
| You have a .edu or university email address | JetBrains Rider | The best refactoring tools you can use, free for one year with a student licence. |
All three options need an internet connection only during installation. Once installed, you can write, run and debug C# completely offline. If your power and connection are unstable, do your installs during stable windows.
Option 1: Visual Studio 2022 Community
Download and install
- Visit: https://visualstudio.microsoft.com/downloads/
- Choose: Visual Studio 2022 Community (free for students and individuals)
- Download: ~3 to 4 GB. Plan for a 6 to 10 GB final install.
Pick the right workloads
During installation, the installer asks you to pick "workloads". Workloads are bundles of tools. Pick only what you need:
Essential:
- .NET desktop development
- ASP.NET and web development
Optional, you can add these later:
- Data storage and processing (for database work)
- .NET Multi-platform App UI development (for mobile apps)
Skipping the optional ones now keeps your install size down and your machine snappier.
First launch
- Sign in with a Microsoft account (free)
- Choose your colour theme. Most developers prefer Dark.
- Choose development settings: pick "C#".
Option 2: Visual Studio Code + .NET SDK
If your machine is older, or you want a lighter footprint:
Install the .NET SDK
- Visit https://dotnet.microsoft.com/download
- Download .NET 8 SDK
- Run the installer
- Verify the install by opening a terminal and running:
dotnet --version
You should see something like 8.0.100. If you do, the SDK is installed correctly.
Install VS Code
- Download from https://code.visualstudio.com
- Open VS Code, go to the Extensions panel (left sidebar)
- Install the C# Dev Kit extension by Microsoft (this installs the core C# extension automatically)
Option 3: JetBrains Rider (with a student licence)
If you have a .edu or university email address, JetBrains offers a free educational licence that includes Rider plus their other IDEs.
Apply for the student licence
- Visit https://www.jetbrains.com/community/education/#students
- Apply with your university email
- Approval is usually instant if your email domain is recognised, otherwise it can take a day or two
Install Rider and the .NET SDK
- Download Rider from https://www.jetbrains.com/rider/download/
- Install the .NET 8 SDK (same step as Option 2 above)
- Open Rider, sign in with your JetBrains account and activate the licence
Why developers love it
Rider's refactoring tools and code navigation are widely considered the best in the industry. Find Usages, Rename and Extract Method all work across your whole solution in milliseconds. Once you have used them, going back to other IDEs can feel slow.
Creating your first project
From Visual Studio
- Click "Create a new project"
- Pick "Console App"
- Project name:
HelloWorld - Framework: .NET 8.0
- Click "Create"
From the command line (works for both VS and VS Code)
dotnet new console -n HelloWorld
cd HelloWorld
dotnet run
The first time you run dotnet run, .NET compiles your code and executes it. You should see Hello, World! in the terminal.
Understanding the default code
When you create a new console app on .NET 8, you'll see:
// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");
That single line is a complete C# program. Modern C# hides the boilerplate.
Older versions of C# required more ceremony:
using System;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello, World!");
}
}
}
Both work. Modern C# is more concise. You will still see the older shape in real codebases, so it is worth recognising.
Worked example: your first interesting program
Replace the default code with this and press F5 (or run dotnet run):
Console.WriteLine("Hello from South Africa!");
Console.WriteLine("My first C# program");
Console.WriteLine($"Today is {DateTime.Now:dd MMMM yyyy}");
Console.WriteLine($"The time is {DateTime.Now:HH:mm}");
You should see something like:
Hello from South Africa!
My first C# program
Today is 21 May 2026
The time is 09:32
In four lines you have already used three serious C# concepts: a built-in class (Console), a method call (WriteLine) and date/time formatting (:dd MMMM yyyy).
Six shortcuts worth remembering
You do not need to memorise all of these today, but bookmark this list:
- F5: Run with debugging
- Ctrl+F5: Run without debugging (faster startup)
- Ctrl+.: Quick actions and refactorings (genuinely useful)
- F12: Jump to where something is defined
- Ctrl+Space: Trigger IntelliSense suggestions
- Ctrl+/: Comment or uncomment the current line
The first time you use Ctrl+. to auto-fix an error, it feels like cheating. Use it often.
If something goes wrong
Setup is fiddly. The three issues we see most often:
| Problem | Try this |
|---|---|
.NET SDK not found | Restart Visual Studio (or your terminal) after installing the SDK. Restart your machine if it still doesn't pick up. |
| IntelliSense not working in VS Code | Make sure you installed the C# Dev Kit extension, not just plain "C#". Reload the window. |
| Program won't start | Check you created a Console App, not a Class Library. Class Libraries don't run on their own. |
If you get stuck for more than 20 minutes on the same setup issue, ask in the community forum. Setup problems are usually environment-specific and someone else has hit yours before.
What's next
You have an IDE, a working compiler and your first running program. The next lesson takes you through what each piece of the default code actually does.