C# Interactive in Visual Studio Community on Mac

Viewed 3826

I'm trying to do some treehouse tutorials on C#. Unfortunately, the instructor is teaching this course in an windows machine with a windows version of VS Community while I follow along VS Community for mac. Got to a point where she is trying to use the C# interactive (REPL) but I can't seem to find it on the mac version. Anyone know if its even possible to do this on the mac? Thanks.

4 Answers

You can't run it in Visual Studio. You can, however, use the terminal.

When you install mono the command csharp gets installed as well. Simply type csharp and the terminal will become a C# interactive window.

enter image description here

If you have Mono installed you can also use: csi

example of csi prompt

Use Xamarin Workbooks!

If you don't like Xamarin Workbooks for whatever reason, you can also use csi in the console, but it doesn't have code completions :/ I couldn't edit Sachin's answer above, but to be more clear, all you need to do is open the terminal and type csi to start the C# interactive tool. Of course this only works after you've installed Visual Studio (it should have installed Mono in the process).

Related