Question

Is there a way to use the C# interactive shell window (from the Roslyn CTP) outside of VS? Or is there something similar to it that is available?

Was it helpful?

Solution 2

After several years (ugh!) there is finally something in this space! CShell. From the site:

CShell is an interactive C# scripting environment. It allows you to use C# without any fluff right in a console like environment caled a read-eval-print-loop (REPL). Your code is directly evaluated and executed in a shell window, no separate executable has to be compiled and then run in a different process. More elaborate code can be written in a C# script and then evaluated as one file, only one line, or a selection. Then, your results can be easily dumped to HTML (like LINQPad) or viewed as a data grid or plotted to a chart.

OTHER TIPS

Right now, the interactive window only works inside Visual Studio. Roslyn exposes a scripting API which the interactive window uses, so you really want an interactive window running somewhere else, feel free to write it!

To be clear, the C# Interactive window uses several Visual Studio components (such as the VS Editor), so it cannot be hosted outside of VS. As Jason Malinowski said, you can create a quick-and-dirty Interactive window outside of VS pretty easily using the Roslyn Scripting APIs. Also, if you're looking to evaluate code outside of VS, you can create a C# Script file (.csx), add top-level code just as you can in the Interactive window, and run it with the rcsi.exe binary that ships with the Roslyn CTP.

Here is a quick Example, pretty minimal though. Don't support blocks {}

http://www.amazedsaint.com/2011/10/c-vnext-roslynan-introduction-and-quick.html

csi.exe is the command-line version of C# interactive. It's shipped in the box with Visual Studio. Type csi from a Developer Command prompt.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top