“Execute in Interactive”– Send to C# Interactive Window – Visual Studio 2015

“Execute in Interactive”– Send to C# Interactive Window – Visual Studio 2015

“Execute in Interactive” feature is great addition with the new Visual Studio 2015 Update.  Previously I shared several posts on C# Interactive Window , discussed about how to work with itHow to execute scripts using interactive Window ? . Recently I shared another quick tip  on Calling current project methods from C# Interactive Window in Visual Studio 2015 ? which talks about interacting with current projects. While this works well, you need to load the assembly or the executive file first before you execute any code inside the Interactive Window.

Well, this is now more simpler and you can interact with your current project code easily by sending them to interactive Window. The recent updates of Visual Studio 2015 now support “Executive in Interactive” by which you can send the code directly to  Interactive Window.

  • Select the Line or Block of Code which you want to send in Interactive Windows
  • Right Click, and from the Context menu select “Execute in Interactive’’”

image

This will send the code directly to Interactive Command Windows.

image

You can now start using names inside interactive Windows.

Here is the interesting facts, if your code has executable, for an example writing something to Console, the Interactive Window will execute it automatically.

For an example you select the below code block and then choose “Execute in Interactive”

image

 

This will not only push the code to Interactive Window, it will also execute the same as given in below snapshot.

image

All in all, this is a great addition and can help developer quickly push some code to interactive window and test them out.

Interactive

Hope this helps

Abhijit Jana

Abhijit runs the Daily .NET Tips. He started this site with a vision to have a single knowledge base of .NET tips and tricks and share post that can quickly help any developers . He is a Former Microsoft ASP.NET MVP, CodeProject MVP, Mentor, Speaker, Author, Technology Evangelist and presently working as a .NET Consultant. He blogs at http://abhijitjana.net , you can follow him @AbhijitJana . He is the author of book Kinect for Windows SDK Programming Guide.

3 Comments to ““Execute in Interactive”– Send to C# Interactive Window – Visual Studio 2015”

  1. Hi, c could you please tell me is there a configuration to enable ‘Execute in Interactive’ option. Is it come with specific edition. I am using VS Professional 2015 v 14.0.24720.00 Update1.

Comments are closed.