DEV Community

Galdin Raphael
Galdin Raphael

Posted on • Originally published at gldraphael.com on

5

C# REPL using mono or dotnet-script

Quite often, all I want to do is check if a single line of code does what I think it does. I've always been a huge fan of LinqPad for a use-case like this. But it's Windows-only and that's a bummer since I do most of my development on a Macbook.

I began googling around a few days back and was pleasantly surprised to find two great options:

The mono-tools csharp REPL

  1. Install mono.
  2. Type csharp in your terminal to start a REPL.

Here's what it looks like:

The REPL is documented here.

The .NET Core dotnet-script global tool

  1. Install .NET Core.
  2. Install the global tool using dotnet tool install -g dotnet-script.
  3. Type dotnet script in your terminal.

Here's what it looks like:

This tool covers a lot of use-cases beyond a basic REPL and they're all documented in its GitHub repo.

For me though, a simple REPL with intellisense is all I want!

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay