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开发者_Go百科 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.
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.
You can use the command-line C# compiler csc
.
It's as simple as writing a makefile, really.
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.
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
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/
Unit tests and TDD. It's the closest thing to REPL you can get in a static language.
精彩评论