“Initialize Interactive with Project”– Run Interactive with context to Project–Visual Studio 2015

By | May 24, 2016

The Interactive Window in Visual Studio is a great utility to play around the code, language features, API’s and other .NET framework features.  The Interactive Window also support features like IntelliSense, syntax highlighting and navigating through executed commands.  There  are several use cases for this Interactive Window, and several ways to work around it. In this quick post we will see how we can run the Interactive Window with context to a Project.

Directly Initialize Interactive with Project Vs. Manual Loading of Assembly / Projects

To launch the Interactive window navigate through  Views > Other Windows > C# Interactive. Here you can add your code and execute it.

Read this post for details :  Use C# Interactive Window for your coding experiment in Visual Studio 2015

using Language Features in Interactive

The Interactive Windows works stands alone, if you want to call any of the current project methods, or want to run the context of the project you need to load the assembly at very first step.

Read This Post for Details : Calling current project methods from C# Interactive Window in Visual Studio 2015 ?

Then use #r to load the DLL or Executable in to it. for an example, #r “<dll path>”

Loading Assembly into Interactive

With the Visual Studio 2015 Update 2, you can do the same thing in much faster and cleaner way.  Right click on the project from solution explorer, and from the context menu select “Initialize Interactive with Project” option.

Initialize Interactive with Project


This will automatically load all the required assembly and the executable in the context of selected project.

Initialize Interactive with Project

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

Now you can use and execute other script from the context of the project inside the Interactive.

Hope this helps !

4 thoughts on ““Initialize Interactive with Project”– Run Interactive with context to Project–Visual Studio 2015

  1. Pingback: Dew Drop – May 25, 2016 (#2259) | Morning Dew

  2. Travis Dean

    Does this also work with F# projects? It seems this feature would be even more useful there.

  3. Pingback: Visual Studio – Developer Top Ten for May 31st, 2016 - Dmitry Lyalin

  4. Abhijit Jana Post author

    Hi, Yes. It is too available for F#. F# Does have Interactive Window and You can use it in Project Context as well.
    Send Project Output to F# Interactive

Comments are closed.