Holy crap. I wish I knew about this before. I used to use LinqPad for these simple tests.
Suppose you want to verify what a certain format of DateTime is. Before LinqPad I would occasionally spin up a new console project to verify.
Turns out Visual Studio has a shortcut for this. It is CTRL + E + E
Enter expression, hit enter, see result. 🙂
It also works by highlighting a block of code and hitting the key combo. It will auto execute and show you the results.
The shell can even use classes from your project! Just right click on your solution and select “Reset Interactive from Project”.
Filip Ekberg has a more detailed description: Using the C# Interactive Window that comes with Roslyn – Part 2