Test the method by passing the parameter value in the method. Now select the method or function you want to test in the C# Interactive window and right-click and select Execute in Interactive.
Check the below example, I have created a Calculator class which has an Add, Subtract, Multiply, and Divide method. For this, we have to just select the method which we want to test/access in the C# Interactive Window. We can execute any code block in the Interactive Window. Intelligence feature is also available in the Interactive window, which makes it easy to use. C# Interactive window supports C# 6 and C# 7 as well. In the below example, I have declared a string variable and displayed the output in the C# Interactive Window. We can execute C# code in the interactive window easily. History Next: For checking the next step/command executed in the C# Interactive Window. History Previous: For checking the previous step/command executed in the C# Interactive Window. Reset: Reset will reset all the DLLs, methods, etc., loaded in the C# Interactive window.Ĭlear: Clear will clear the screen of the C# Interactive Window. The C# Interactive window has 4 options in the window that is as below: C# Interactive mode will be available in the command prompt. cs file and then click on Execute in Interactive (shortcut is Ctrl+E, Ctrl+E).įrom Visual Studio command prompt: Open Visual Studio Developer command prompt. We can open C# Interactive window in multiple ways:įrom Menu Bar: Go to View Menu then move the cursor to Other Windows and then click on C# Interactive.įrom context box: Right click on the. Open C# Interactive window in Visual Studio. With the C# Interactive window, we can test our code snippet without compiling or running the complete code. Read-Evaluate-Print-Loop with an advanced editor. In this article, I am using Visual Studio 2017 for demonstration purposes.
HOW DO YOU PRINT IN VISUAL STUDIO ON A MAC UPDATE
The C# Interactive window has been a part of Visual Studio since the Visual Studio 2015 update 1 release.
HOW DO YOU PRINT IN VISUAL STUDIO ON A MAC HOW TO
In this article, we will learn how to use C# Interactive in Visual Studio.