Search code examples
c#.netread-eval-print-loop

C# Console/CLI Interpreter?


I wonder if there is something like a standalone version of Visual Studio's "Immediate Window"? Sometimes I just want to test some simple stuff, like DateTime.Parse("blah") to see if that works. But everytime I have to create a new console application, put in my code and test it.

The Immediate Window sadly only works when I am debugging something. Could PowerShell do that? Just open a CLI similar to what cmd.exe does, allowing me to execute some C# code?


Solution

  • Linqpad - I use it like this all the time. http://www.linqpad.net/

    Don't be misled by the name - that just describes the original motivation for it, not its functionality.

    Just recently he released a version with proper statement completion - that's a chargeable add-on (the core tool is free), but a minute amount of money and well worth it, I think.