Skip to content

Getting Started

Get the SDK

To get started with .NET, you can download the SDK binaries for your platform from the official download page.

🙋🏻‍♀️ Do I need Windows to write C#?

Definitely not! That's a myth and one of the purposes of this guide is to help shed these myths!

I work on C# on macOS full time and the last startup (VC-backed, $8m seed), the entire team worked on M1 MacBook Pros and we shipped to AWS t4g Arm64 instances. You definitely do not need Windows to work on C#; the experience in VS Code isn't any different from TypeScript. Just as you would add the TypeScript language extension to VS Code, install the C# language extension as well.

Get an IDE

There are three primary IDEs depending on which platform you are on:

IDEPlatformsPricingGreat For...
VS CodeLinux, macOS, WindowsFreeConsole apps, web APIs, Blazor web apps; get the C# extension (or the C# DevKit extension if you prefer some of the visual features around project and solution management similar to Visual Studio)
CursorLinux, macOS, WindowsFreeUsed the Cursor provided C# extension or install Dotrush
RiderLinux, macOS, WindowsFree for non-commercial useAll .NET project types, devs who like JetBrains IDEs, devs who need the BEST refactoring tools.
Visual StudioWindowsFree community licenseAll .NET project types

Of course, you can also use vim!

If you don't want to install the SDK, then just start with the Polyglot Notebooks extension which will let you try C# using C# interactive (see below).

TIP

In general, I find that VS Code with the C# or DevKit extension to be perfectly fine even for large .NET codebases. I have used it with a 100,000 line codebase at a startup without issues. I strongly recommend starting there since you are probably already using it for your TypeScript work!

Where Jetbrains Rider shines is when you need to do complex refactorings.

Get .NET Interactive and Polyglot Notebooks

VS Code Polyglot Notebooks (available via this extension) are a great way to experiment with C# without setting up a runtime infrastructure.

This is a great way to get started and experiment and, in fact, you'll find a notebook in this repo in src/csharp/csharp-notebook.dib!

Use .NET 10 File-Based Apps

Introduced with .NET 10, file-based apps are the easiest way to get started with C#.

Just create a file and you're ready go to!

bash
> mkdir file-app-demo
> cd file-app-demo
> echo 'Console.WriteLine("Easy!");' > app.cs
> dotnet run app.cs

> Easy!

Now you can edit this file and start writing code and when you're ready, it can be converted to a normal project as well.

Check out the tutorial on the Microsoft docs for more info.

This is the easiest way to start writing simple console apps and you can even build web APIs by adding in standard packages and SDKs!

csharp
#:sdk Microsoft.NET.Sdk.Web
// 👆 This line pulls in the Web API SDK

Console.WriteLine("App starting");

// 👇 Now configure and start the web server
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();

app.MapGet("/", () => "Hello World!"); // 👈 A single endpoint

app.Run();

// dotnet run app.cs
// curl http://localhost:5000 -> "Hello World!"