Is there an interactive interpreter for C#?

C#Shell

C# Problem Overview


Sometimes it's handy to have access to your language to do quick things without starting Visual Studio and creating a new console app.

Is there something like Python's interactive mode or groovy shell, except for C#?

C# Solutions


Solution 1 - C#

With the Visual Studio 2015 Update 1 there now is a C# Interactive tool window built into Visual Studio.

The new tool window is invoked by going to ViewOther WindowsC# Interactive.

For Visual Studio 2010 to 2013 you can use the Roslyn CTP to get a similar tool window in Visual Studio.

Solution 2 - C#

Have a look at CsharpRepl (part of the Mono project). Never used it myself, I hasten to add.

For LINQ stuff, you should also look at LINQPad.

Solution 3 - C#

Solution 4 - C#

Like others noted, Mono's CSharpRepl is probably the right answer. However, if you're not fixed to C#, then PowerShell is a pretty nice environment of playing around with .NET. I frequently use it to test regular expressions, format strings, etc. All the kinds of stuff you have ConsoleProject163 lying around for :)

Solution 5 - C#

In addition to the other good answers here (+1), there is also CSI and the immediate window in Visual Studio.

Solution 6 - C#

Here is a Mono CsharpRepl which is what you are looking for.

> This documents the features available > in the C# interactive shell that is > part of Mono's C# compiler. An > interactive shell is usually referred > to as a read eval print loop or repl. > The C# interactive shell is built on > top of the Mono.CSharp > (http:/monodoc/N:Mono.CSharp) library, > a library that provides a C# compiler > service that can be used to evaluate > expressions and statements on-the-fly.

Solution 7 - C#

There is ScriptCS which uses the Roslyn CTP nuget package.

Solution 8 - C#

I think [CShell] would be a nice contribution to answers given here. It provides code completion enabled REPL command window as well as a lightweight workspace management tools to include some scratch files and library references.

[CShell]: http://cshell.net/ "CShell"

Solution 9 - C#

With Roslyn CTP there now is a full C# interactive window from Microsoft direct in Visual Studio!! Works great! So far runs all my libraries. After install: Invoking View -> Other Windows -> C# Interactive from the menu.

Solution 10 - C#

I use ideone.com sometimes, but LINQPad is a good choice if an install is acceptable.

Solution 11 - C#

You can use this developed by Miguel De Icaza, is shipped with mono and have code completion

Solution 12 - C#

If you are looking for a simple web based environment to crank out some C# code try coderpad.io Not sure if you can add libraries n' all but its a quick and simple solution if you are just interested in testing out several commands

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSethView Question on Stackoverflow
Solution 1 - C#Daniel RoseView Answer on Stackoverflow
Solution 2 - C#Jon SkeetView Answer on Stackoverflow
Solution 3 - C#user113476View Answer on Stackoverflow
Solution 4 - C#JoeyView Answer on Stackoverflow
Solution 5 - C#Craig StuntzView Answer on Stackoverflow
Solution 6 - C#David BasarabView Answer on Stackoverflow
Solution 7 - C#TimView Answer on Stackoverflow
Solution 8 - C#PaulView Answer on Stackoverflow
Solution 9 - C#GregorView Answer on Stackoverflow
Solution 10 - C#Ian NewsonView Answer on Stackoverflow
Solution 11 - C#Kristian DamianView Answer on Stackoverflow
Solution 12 - C#PinkyView Answer on Stackoverflow