views:

165

answers:

7

I'm sure something like this exists, but I can't for the life of me remember what it is called.

I'm looking for an app where I can just execute an arbitrary block of C# code and see any console output.

+13  A: 

http://www.sliver.com/dotnet/SnippetCompiler/

Alex Reitbort
Damn, 11 seconds
Tinister
Thank you! :) 15char
Daniel Schaffer
+1 Very Nice Tool.
RRUZ
+7  A: 

Snippet Compiler

Tinister
+2  A: 

There is also LINQ Pad. It will work as a snippet compiler and lets you run linq against sql server.

Mike Two
+3  A: 

Not necessarily a snippet compiler but I use it for that purpose also:

The neat thing about it is that you can dump intermediate results to the output and has very nice formatting for all types of objects so you won't have to write Console.WriteLine(...) statements.

You can also write only expressions, or simple statements or classes, and it will compile all of them.

Pop Catalin
Since I discovered LINQPad, I can't live without it... it's really handy when you need to test a few lines of code without creating a new VS project
Thomas Levesque
+1  A: 

Mono has GSharp, which I personally use all the time.

http://tirania.org/blog/archive/2008/Nov-02.html

overstood
A: 

Another approach is offered by TestDriven.Net, which allows you to click on any method in the Visual Studio code editor and run it directly.

This can be useful for debugging code that's otherwise buried a little deep to conveniently access.

Bevan
A: 

To round out the other answers, there's also:

LINQPad is my favorite :)

Ahmad Mageed