Is there an interactive interpreter for C#? [closed]

Update for 2022

After installing Visual Studio 2022, add the following to your PATH environment variable.

C:\Program Files (x86)\Microsoft Visual Studio\Shared\Packages\Microsoft.Net.Compilers.2.6.1\tools

Then open your terminal (CMD, PowerShell, Windows Terminal) and type csi to run C Sharp Interactive.

You’ll get something like this:

PS C:\> csi
Microsoft (R) Visual C# Interactive Compiler version 2.6.1.62414
Copyright (C) Microsoft Corporation. All rights reserved.

Type "#help" for more information.
> var list = new List<int>{ 1, 2, 3, 4 };
> list // You don't need to call Console.WriteLine() to see values
List<int>(4) { 1, 2, 3, 4 }
> // You can keep adding lines as needed

Previous Answer

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.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)