Set Up C# Development: Visual Studio vs VS Code vs Rider, and the .NET CLI

C# development needs two things: the .NET SDK, which compiles and runs your code, and an editor that understands C#. The SDK ships the dotnet command-line tool. The editor is a choice between Visual Studio 2026, VS Code with C# Dev Kit, and JetBrains Rider. Every option sits on the same SDK, so your projects stay portable between them.

Quick Takeaways

  • Install the .NET 10 SDK first. It is the current long-term support release and includes C# 14.
  • Pick Visual Studio for Windows-only desktop, WPF, WinForms, or deep Azure work. Pick Rider for cross-platform work and heavy refactoring. Pick VS Code for a light, fast editor.
  • All three build with the same dotnet CLI. Learn the CLI once and it works everywhere, including CI pipelines.
  • Check licensing before you commit. Rider and the C# Dev Kit are free for some uses, but commercial teams may need a paid license.
Feature Visual Studio 2026 VS Code + C# Dev Kit JetBrains Rider
Platforms Windows Windows, macOS, Linux Windows, macOS, Linux
Weight Heavy Light Medium
Debugger Best-in-class Good Very good
Refactoring Strong Basic to good Excellent
Cost Free Community tier Free editor, extension licensed Free non-commercial
Best for Windows and enterprise Lightweight, polyglot work Cross-platform teams

Step 1: Install the .NET SDK

The SDK includes the compiler, the runtime, and the dotnet CLI. Install it before any editor.

.NET 10 is an LTS release, supported for three years until November 10, 2028. C# 14 is included in the .NET 10 SDK. Download the installer from the official .NET site, or use your package manager.

# Windows (winget)
winget install Microsoft.DotNet.SDK.10

# macOS (Homebrew)
brew install --cask dotnet-sdk

# Ubuntu / Debian
sudo apt-get update && sudo apt-get install -y dotnet-sdk-10.0

Verify the install:

# Print the installed SDK version
dotnet --version

# List every installed SDK and runtime
dotnet --list-sdks
dotnet --list-runtimes

The first command prints a 10.0.x version string. The list commands show every side-by-side install. You can keep multiple SDKs on one machine, and a global.json file pins the version per repository.

Step 2: Choose Your Editor

Visual Studio 2026

Visual Studio is the full IDE. It is the first major upgrade since Visual Studio 2022 launched in November 2021. It supports .NET 10 and C# 14, and installs side by side with older versions.

Strengths:

  • Integrated debugger, profiler, and memory tools.
  • First-class designers for WPF, WinForms, and .NET MAUI.
  • Deep GitHub Copilot integration.
  • Native support for the full .NET Framework.

Visual Studio 2026 supports Windows 11 and Windows Server 2019 or later, and the official list excludes Windows 10 clients. Check your OS before installing. It does not run on macOS or Linux.

Install the ASP.NET and web development workload for APIs, or .NET desktop development for WPF and WinForms.

VS Code with C# Dev Kit

VS Code is a lightweight editor. You add C# support through extensions.

Two layers matter:

  • C# extension: It is MIT licensed and provides rich language support for C#.
  • C# Dev Kit: It adds a solution explorer, project templates, and test discovery and debugging.

C# Dev Kit uses the same license model as Visual Studio. That makes it free for individual, educational, and open-source development under Visual Studio Community terms. For organizations, it comes with Visual Studio Professional and Enterprise subscriptions, as well as GitHub Codespaces.

Install from the terminal:

# Install the C# Dev Kit (pulls in the base C# extension automatically)
code --install-extension ms-dotnettools.csdevkit

The command installs both extensions. Open a folder containing a .csproj or .sln file and the extension activates.

Licensing note: the official C# Dev Kit extension requires a license for larger teams, and the official .NET debugger is not licensed for VS Code forks such as Cursor. JetBrains offers an alternative here. ReSharper for VS Code works in Cursor and Google Antigravity, and is free for non-commercial use.

JetBrains Rider

Rider is a cross-platform .NET IDE built on the ReSharper engine. It runs the same on Windows, macOS, and Linux.

The free non-commercial version is a full-featured IDE, identical to the paid one apart from Code With Me. Non-commercial use covers learning, content creation, open source, and hobby development. If you plan to release the product and earn commercial benefits, now or later, you need a commercial license. You cannot opt out of anonymous usage statistics on the free license.

Strengths:

  • Deep refactoring and code inspections.
  • Consistent behavior across operating systems.
  • Strong support for Unity, Godot, and Unreal game projects.

Step 3: Build a Project with the .NET CLI

The CLI creates, builds, tests, and publishes projects without any editor. Use it to understand what your IDE runs behind the scenes.

Create a Console App

# Create a new console project in a folder named HelloApp
dotnet new console -n HelloApp -o HelloApp

# Move into the project folder
cd HelloApp

This generates HelloApp.csproj and Program.cs. The top-level statements style removes the Main method boilerplate.

// Program.cs
// Top-level statements: the compiler generates the entry point.
using System.Globalization;

string name = args.Length > 0 ? args[0] : "developer";
var greeting = string.Create(CultureInfo.InvariantCulture, $"Hello, {name}!");

Console.WriteLine(greeting);

Run it:

# Build and run in one step, passing an argument after "--"
dotnet run -- Ada

The output is Hello, Ada!. The -- separator tells the CLI that everything after it belongs to your program.

Core CLI Commands

Command Purpose Notes
dotnet new <template> Scaffold a project Run dotnet new list to see templates
dotnet restore Download NuGet packages Runs implicitly on build
dotnet build Compile the project Output goes to bin/
dotnet run Build and execute Best for local iteration
dotnet test Run unit tests Works with xUnit, NUnit, MSTest
dotnet publish Produce deployable output Use -c Release
dotnet add package Add a NuGet dependency Edits the .csproj
dotnet watch Rebuild on file change Enables hot reload

Create a Solution with Multiple Projects

Real applications split code into a library, an app, and tests. A solution file groups them.

# Create the solution and three projects
dotnet new sln -n Shop
dotnet new classlib -n Shop.Core -o src/Shop.Core
dotnet new webapi   -n Shop.Api  -o src/Shop.Api
dotnet new xunit    -n Shop.Tests -o tests/Shop.Tests

# Register the projects in the solution
dotnet sln add src/Shop.Core src/Shop.Api tests/Shop.Tests

# Wire up project references
dotnet add src/Shop.Api reference src/Shop.Core
dotnet add tests/Shop.Tests reference src/Shop.Core

Open Shop.slnx or Shop.sln in any of the three editors. The structure is identical in each.

Note: On .NET 10 the dotnet new sln command can produce the newer XML-based .slnx format. Tools older than Visual Studio 2022 17.13 may not open it. Check what file the command generated.

Run a Single File Without a Project

C# 14 introduces file-based apps, which are single .cs files that resemble scripts. You can convert a single-file app to a full project with dotnet project convert.

// hello.cs
// A file-based app: no .csproj required.
Console.WriteLine($"Running on {Environment.Version}");
# Execute the file directly with the .NET 10 SDK
dotnet run hello.cs

The output prints the runtime version. This is ideal for quick experiments and scripts.

Step 4: Pin the SDK Version

Teams need the same compiler on every machine. A global.json file at the repository root locks the SDK.

{
  "sdk": {
    "version": "10.0.100",
    "rollForward": "latestFeature"
  }
}

With latestFeature, the CLI accepts a newer feature band of the same major and minor version. Use disable to demand an exact match. A mismatch produces a clear error instead of a silent behavior change.

Debugging and Testing Workflow

Each editor wires the debugger to the same dotnet host.

Task Visual Studio VS Code Rider
Start debugging F5 F5 (needs launch.json or Dev Kit) Shift+F9
Run tests Test Explorer Testing view Unit Test Sessions
Hot reload Built in dotnet watch Built in
NuGet UI Package Manager Terminal or extension NuGet tool window

Use dotnet watch outside an IDE to get hot reload anywhere:

# Rebuild and restart on every save
dotnet watch run

The CLI watches your source files and applies changes to the running process when possible.

Best Practices: Bad Setup vs Good Setup

Anti-pattern: Unpinned SDK and Hardcoded Paths

# BAD: relies on whatever SDK is installed and a machine-specific path
cd C:\Users\me\code
dotnet build
<!-- BAD: no target framework discipline, no nullable checks -->
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net10.0</TargetFramework>
  </PropertyGroup>
</Project>

This build depends on each developer’s machine. It also hides null bugs and warnings.

Refactored: Pinned SDK and Strict Compiler Settings

{
  "sdk": { "version": "10.0.100", "rollForward": "latestFeature" }
}
<!-- Directory.Build.props at the repo root: shared by every project -->
<Project>
  <PropertyGroup>
    <TargetFramework>net10.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
    <AnalysisLevel>latest-recommended</AnalysisLevel>
  </PropertyGroup>
</Project>
# GOOD: run from the repo root, works on any machine and in CI
dotnet build -c Release
dotnet test --no-build -c Release

Directory.Build.props applies settings to every project in one place. Nullable reference types catch NullReferenceException risks at compile time. The same commands run in your terminal and in a CI job.

Which Editor Should You Choose?

Your situation Best choice Reason
Building WPF, WinForms, or legacy .NET Framework apps Visual Studio Designers and Framework support
Working on macOS or Linux Rider or VS Code Native cross-platform support
Learning C# on a low-spec laptop VS Code Small footprint
Large codebase with frequent refactoring Rider Deep inspections and refactoring
Unity or Godot game development Rider Engine integration
Mixed stack: C#, TypeScript, Python VS Code One editor for every language
Commercial team with an MSDN subscription Visual Studio Licensing already covered

Common Setup Problems

  • dotnet not recognized: Restart the terminal after installing. The installer updates PATH only for new sessions.
  • Wrong SDK in use: Run dotnet --list-sdks and check for a global.json in a parent folder.
  • C# 14 features fail to compile: C# 14 requires the .NET 10 target. Confirm <TargetFramework>net10.0</TargetFramework>.
  • VS Code shows no solution explorer: Install C# Dev Kit, not only the base C# extension.
  • Licensing prompt in VS Code: Sign in with a Microsoft account, or use the open-source base extension without the Dev Kit.

FAQ

Is Visual Studio or VS Code better for C#?

Visual Studio is better for Windows desktop apps, advanced debugging, and Azure workflows. VS Code is better for a lightweight editor on any operating system. Both build the same projects through the .NET SDK.

Is JetBrains Rider free?

Rider is free for non-commercial use, including learning, open source, content creation, and hobby projects. Commercial work requires a paid license. If you earn commercial benefits from a project now or later, use a commercial license.

Do I need Visual Studio to write C#?

No. Install the .NET SDK and use any editor. The dotnet CLI compiles, tests, and publishes code without an IDE. VS Code, Rider, or even a plain text editor works.

Which .NET version should I install?

Install .NET 10. It is the current long-term support release, supported until November 2028, and it includes C# 14. Use a global.json file to pin the SDK version across your team.

Hot this week

Humanoids in Factories and Warehouses: What They Actually Do Today

Which humanoid robots do real work in factories and warehouses today? See deployment data, ROI math and ROS 2 code. Read the 2026 guide.

Debugging Robot Code: Logs, Serial Output, rosbag, and Foxglove

Debug robot code faster with ROS 2 logging, serial capture, rosbag2 recording, and Foxglove. Copy the configs and scripts into your stack today.

Build a Mapping Robot With SLAM From Scratch

Build a SLAM mapping robot from scratch: wiring, odometry, LiDAR, ROS 2 slam_toolbox config and tuning. Follow the full guide and map your first room.

Depth Cameras: Stereo, Time-of-Flight, and Structured Light Compared

Compare stereo, time-of-flight, and structured light depth cameras: accuracy, range, sunlight, ROS2 setup. Pick the right sensor for your robot.

Python vs C++ for Robotics: Which Should You Use?

Python vs C++ for robotics compared: latency, ROS2 performance, control loops, and code examples. Learn which language fits your robot. Read the guide.

Topics

Humanoids in Factories and Warehouses: What They Actually Do Today

Which humanoid robots do real work in factories and warehouses today? See deployment data, ROI math and ROS 2 code. Read the 2026 guide.

Debugging Robot Code: Logs, Serial Output, rosbag, and Foxglove

Debug robot code faster with ROS 2 logging, serial capture, rosbag2 recording, and Foxglove. Copy the configs and scripts into your stack today.

Build a Mapping Robot With SLAM From Scratch

Build a SLAM mapping robot from scratch: wiring, odometry, LiDAR, ROS 2 slam_toolbox config and tuning. Follow the full guide and map your first room.

Depth Cameras: Stereo, Time-of-Flight, and Structured Light Compared

Compare stereo, time-of-flight, and structured light depth cameras: accuracy, range, sunlight, ROS2 setup. Pick the right sensor for your robot.

Python vs C++ for Robotics: Which Should You Use?

Python vs C++ for robotics compared: latency, ROS2 performance, control loops, and code examples. Learn which language fits your robot. Read the guide.

Build a ROS 2 Rover: Raspberry Pi 5, Motors, and LiDAR

Build a ROS 2 rover with Raspberry Pi 5, RPLIDAR C1, and a Pico motor controller. Copy the code, wire it, and map your room. Start building now.

Imitation Learning for Robots: Teach by Demonstration

Learn imitation learning for robots: behavior cloning, DAgger, ACT, and diffusion policies with ROS2 code. Build your first policy today.

LiDAR for Robots: 2D, 3D, and Solid-State Compared

Compare 2D, 3D, and solid-state LiDAR for robots. See specs, ROS2 configs, code, and a selection workflow. Pick the right sensor now.

Related Articles

Popular Categories