11

Often times, I start a new instance of Visual Studio, just to create a console application that has some output and/or input. It's a temporary sandbox I use to test a method or something else and close a few minutes later.

Can you think of any tools to replace this?

I use to have an application that had two text fields: one on top to take C# code, and one on the bottom, to act as an stdout. But I can't remember the name.

1
  • Why on Earth would you want to replace this? You don't even have to save the project. Commented Feb 5, 2010 at 3:29

6 Answers 6

11

Take a look at LINQPad. It's light-weight and has lots of features. Great for short snippets. Snippet Compiler is another good one. It used to be my main choice before LINQPad. Its author doesn't seem to be actively updating it lately.

These are the two main ones from my suggestions listed here: Are there any alternatives to FastSharp?

EDIT: In addition, the Mono project has a C# REPL.

Sign up to request clarification or add additional context in comments.

2 Comments

This. From the site: "And LINQPad is more than just a LINQ tool: it's a highly ergonomic code snippet IDE that instantly executes any C#/VB expression, statement block or program"
Per your linked answer, I'd add a mention of Snippet Compiler (sliver.com/dotnet/SnippetCompiler).
1

You can use the command-line C# compiler csc.

It's as simple as writing a makefile, really.

1 Comment

+1, Makes perfect sense for very small test applications and would work well with Notepad++ with syntax set to C# (notepad-plus.sourceforge.net/uk/site.htm)
1

In Visual Studio, the Immediate Window allows you to enter commands at runtime, and you can also enter watches - which are more static but also accomplish the same task. Anyway, both could be considered a "poor man's" REPL.

1 Comment

The Immediate Window may be a poor man's REPL, but it can be extremely useful. I wish I had known about it back in 2005.
1

Try the C# REPL Script Environment that is part of the O2 Platform

It will give you a perfect environment to try out all C# features and APIs (conceptually the O2 REPL environment is similar to LinqPAD)

You should also take a look at Roslyn from Microsoft. On Multiple Roslyn based tools (all running Stand-Alone outside VisualStudio) , the first one is a simple Roslyn REPL

Comments

0

Besides the great answers already like LINQPad I'd recommend taking a look at CShell, it's a small C# REPL IDE that let's you type some code in no time.

http://cshell.net/

Comments

-7

Unit tests and TDD. It's the closest thing to REPL you can get in a static language.

3 Comments

C# may be statically typed, but it is still an interpreted language and has bytecode manipulation capabilities, therefore a REPL is possible.
I am a completely static C++ guy, and I still have a REPL for it. What am I doing wrong?
Haskell? Scala? F#?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.