Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import Project to Immediate

Having just installed VS2015 Update 1, I discovered the C# Interactive window.

According to the second post in that series, you should be able to import a project from your solution.

When you want to fire up the C# Interactive Window you can just right click your solution and select "Reset Interactive from Project"

However, this option is not available on my project. I'm using a Console Application to test, and have pushed the framework up to 4.6.1 from 4.5. However, this has not worked.

Additionally, I have attempted to manually import the project. Looking at the screenshots on the website, I should be able to do this like this: #r "ConsoleApplication7.exe" but when I do, I get the following exception:

(1,1): error CS0006: Metadata file 'ConsoleApplication7.exe' could not be found

It will pull in via the filepath, e.g:

#r "bin\Debug\ConsoleApplication7.exe"

However, this is a little unwieldly. Especially since whenever you make changes to the classes, it requires a #reset and re-import.

Is there a better way to import Projects into the Immediate instance?

like image 471
Obsidian Phoenix Avatar asked Dec 08 '15 09:12

Obsidian Phoenix


1 Answers

According to the Comment from Jason Malinowski

It doesn't really answer your question, but unfortunately we had to cut the "Reset from Project" command in Visual Studio 2015 Update 1 just because we were crunched getting everything else done. We don't like that it's not there either.

Jason Malinowski

Therefore, at this time (2016-02-04), the "Reset from Project" option is not available.

Projects can be imported manually, by using the following command:

#r "bin\Debug\ConsoleApplication7.exe"

This should work when you are running the REPL with the solution open in the same instance, and when you have only one project.

At other times, you will need to use the full file path

#r "C:\MySolution\ConsoleApplication7\bin\Debug\ConsoleApplication7.exe"
like image 66
Obsidian Phoenix Avatar answered Oct 26 '22 07:10

Obsidian Phoenix