RunCS

Write C#. Press Ctrl+Enter

RunCS is a desktop scratchpad for C#. Type some code, run it, and read the output beside it. There is no project to create and nothing to set up.

Get RunCS For Windows, Linux and macOS. Needs the .NET 10 SDK.
The RunCS window: a short C# script on the left that groups words by length, and its output on the right. The last line of the script is a bare expression, and its value, 5, appears in the output labelled L10.

An editor that understands the code, and gets out of the way

See values without writing Console.WriteLine

A line that is just an expression, such as Add(2, 3);, shows its value in the output, labelled with the line it came from.

For anything deeper, click beside a line number to add a log point. The next run reports what that line produced: a variable's new value, what a method returned, whether an if was true, or the arguments of each call. Your code stays as it is.

A script with blue diamonds beside five line numbers. The output lists what each of those lines produced, such as the arguments of a method call, initialDistance <= 0 is false, return 40, and total = 2, 6 and 12 from inside a loop, each labelled with its line number.

Completions from the real compiler

RunCS uses Roslyn, the C# compiler's own analysis engine. Start a word or type a dot and it lists what fits, with each entry's signature and documentation alongside.

Open a parenthesis to see a method's overloads, or rest the mouse on a name to see its type.

A completion list open after typing words.Mi, offering Min and MinBy, with the signature and summary of Min shown beside it.

Errors appear where you made them

A mistake gets a red underline and a badge beside its line number as you type. Click either to read the message.

The output pane is kept for what your program prints.

Line 12 assigns a string to an int. It has a red badge in the margin and a red underline, and a popup reads: CS0029, cannot implicitly convert type string to int.

NuGet packages in one line

Search nuget.org from inside RunCS and double-click a result. It adds a single #:package line to the top of your script, and completions for the package follow once it has downloaded.

You can also add your own GitHub Packages feed, or paste a link to a .nupkg file.

#:package Humanizer@2.14.1

using Humanizer;

Console.WriteLine("three_word_name".Humanize());
Console.WriteLine(TimeSpan.FromMinutes(90).Humanize());

Settings that travel with the script

Nullable checks, unsafe code, the language version, Native AOT, console or web: each script has its own build settings.

They are saved inside the .cs file, so the script behaves the same wherever it goes. RunCS keeps those lines out of the editor, so you can't delete them by accident.

The Script settings window, with checkboxes for Native AOT, nullable reference types, implicit usings, unsafe code and warnings as errors, choices for language version and project type, and a switch for showing the value of top-level expressions.

Plain files, plain .NET

Every tab is an ordinary .cs file, and RunCS runs it with dotnet run. A script you write here also runs from a terminal, and a script from anywhere else opens here.

Scripts run with your own permissions. There is no sandbox, so treat code you didn't write the way you would in any terminal.

# the same file, without RunCS
dotnet run scratch.cs

Keys

Ctrl Enter or F5Run the current tab
Shift F5Stop a running script
F9Add or remove a log point on the current line
Ctrl SpaceShow completions
Ctrl TNew tab
Ctrl WClose tab
Ctrl TabNext tab
Ctrl OOpen a script
Ctrl SSave the script
Ctrl PPackages
Ctrl ,Script settings

Get it

  • Install the .NET 10 SDK first. RunCS uses it to build and run your scripts.
  • Download the build for your system from the releases page: Windows, Linux or macOS.
  • Unpack it and start RunCS. Your first tab is ready to type in.