Is there C# interactive window for VS 2013, or any other similar way, without installing VS 2012. I tried C# Repel, C# Snippet Compiler and Mono Command Prompt, but, all of them don't provide the features of C# interactive window packed with Roslyn for VS 2012.
-
1Keep track of this thread social.msdn.microsoft.com/forums/vstudio/en-US/… I guess when something comes out it will appear there first.– kzfabiJul 7, 2014 at 14:51
-
I've already found that article... Wasn't there any official announcement?– IWIHJul 7, 2014 at 18:06
-
1No that I'm aware of.– kzfabiJul 7, 2014 at 22:13
6 Answers
UPDATE: Found a total better alternative!!! Try CShell, it is free and open source! "A simple, yet powerful, C# scripting IDE" as they promote it. Check my tweet which was also favorited by Scott Hanselman :)
My old recommendation was: LINQPad
-
-
No, it works with everything you want of the language. Check the docs. You can even import your own assemblies to use just like Roslyn.– kzfabiJul 7, 2014 at 22:12
-
Indeed, it's not exactly interactive, you write your code then run it... not working interactively.– IWIHJul 23, 2014 at 23:25
-
1Just for other readers: past comments were talking about LINQPad, not CShell.– kzfabiSep 15, 2014 at 14:51
Best way is to install VS 2012 and use C# interactive window provided with its Roslyn. While doing that, wait Microsoft to release C# interactive to VS 2013.
-
1
-
1VS 2012.4: microsoft.com/en-us/download/details.aspx?id=39305 VS 2012 SDK: microsoft.com/en-us/download/details.aspx?id=30668 Roslyn CTP: microsoft.com/en-us/download/details.aspx?id=34685– IWIHJan 13, 2015 at 14:47
-
1This is so great. Can't wait for the RTM of Roslyn! I'm on VS2013.4. Jan 14, 2015 at 13:57
This is taken from one of the links above: http://social.msdn.microsoft.com/forums/vstudio/en-US/0da45fe7-fbe2-4074-b52f-dc8d7c4b2ba3/c-interactive-in-vs-2013
It worked for me, so hopefully this will help the next person :)
Hi SpencerGR,
I just got upgraded to VS 2013 and wanted C# Interactive, and this is the first hit when I searched for it, so I figured I would place my answer here...
Didn't make sense to me that the extension from VS 2012 wouldn't work; so I hunted down the Roslyn keys in my registry for VS 2012 and was able to kinda figure out what was going on. After a bit of futzing around, I finally got it working, so here's the instructions for whoever might care to try [be warned, I'm sure this isn't supported by MS, I take no responsibility if something happens to mess up your computer, and so forth ;)].
Basically it was a matter of
copying some registry keys with slight modification copying some files and this one is annoying but oh, well] there's a file you have to change the datestamp on (I did it by opening the file in Notepad++ and saving it out.) If you don't already have VS 2012 or you don't have the Roslyn CTP installed you'll need to get the files somehow, and I'm not sure if there are other registry settings needed or not, but I imagine if you just manage to get the files out of the CTP distro it would be enough... No guarantees of course.
Not-Instructions-Just-An-Explanation-Of-What-I-Did-I-Am-A-Trained-Professional-...-Or-Something ;)
- copying some registry keys with slight modification; I replaced '11.0' with '12.0' in the keys and values, you might need to change the paths too if you didn't install Visual Studio in it's default location. (also posted to pastebin.com/XeP5ai8F )
Save this as a .reg file and open it to import the new keys easily:
Windows Registry Editor Version 5.00.
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\InteractiveWindows\0] "ContentType"="Roslyn C#"
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0_Config\InstalledProducts\Roslyn] ""="Microsoft Roslyn CTP" "ProductDetails"="Microsoft Roslyn CTP"
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0_Config\Packages\{c5edd1ee-c43b-4360-9ce4-6b993ca12897}] "Class"="Roslyn.VisualStudio.CSharp.Repl.CSharpReplPackage" "CodeBase"="C:\\Program Files (x86)\\Microsoft Visual Studio
12.0\\Common7\\IDE\\Extensions\\Microsoft\\Roslyn C# Interactive Window\\1.2.20906.1\\Roslyn.VisualStudio.CSharp.Repl.dll"
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0_Config\Packages\{f5199a4e-6a60-4f79-82e9-fc92a41c4610}] "Class"="Roslyn.VisualStudio.InteractiveWindow.InteractiveWindowPackage" "CodeBase"="C:\\Program Files (x86)\\Microsoft Visual Studio
12.0\\Common7\\IDE\\Extensions\\Microsoft\\Roslyn Components\\1.2.20906.1\\Roslyn.VisualStudio.InteractiveWindow.dll"
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0_Config\ToolWindows\{2d0a56aa-9527-4b78-b6e6-ebe6e05da749}] "Name"="Roslyn.VisualStudio.InteractiveWindow.VsInteractiveWindow"
copying some files; basically just need to copy the files mentioned above to the locations mentioned above; I just copied the 'Common7\IDE\Extensions\Microsoft\Roslyn C# Interactive Window' and 'Common7\IDE\Extensions\Microsoft\Roslyn Components' folders from my 11.0 install to my 12.0 install. easy peasy.
and yeah... there's a file in the aforementioned 'Common7\IDE\Extensions' directory called 'extensions.configurationchanged'; I couldn't get things to take, then I noticed that file. so, as mentioned, I just opened in Notepad++ and saved back out; I think I had to make a change to the file, so I added a space. kinda felt kludgy, but I guess it beats VS taking longer to load due to having to scan the Extensions every time you open it up.
So, that's it! Worked for me, I hope someone else may find this useful, as it probably took longer to post this than it did to actually get it working in the first place. ;) It's possible I missed a step in here somewhere, since I had made a few other attempts before I found the 'changed' file, so I could have possibly twiddled another bit somewhere that was necessary that I don't remember. Should be a good start tho.
I haven't tested it out fully by any means but it shows up in the 'View > Other Windows' list, it opens up just find, and it looks like Intellisense is working too. Good luck and great code to all! :)
--- Chelle L.
-
I've managed to run this in VS 2013, but not in VS 2015, have you tried it in VS 2015? Aug 25, 2015 at 14:33
You could also use LinqPad. You can use it to test C# code. It has built in support for loading DLLs and Nuget Packages. Its what I use personally and I love it.
It has a free version, but the paid version has intellisense and debugger
C# interactive finally arrived to VS 2015... You may need to install vs2015.1 to get it..
http://blogs.msdn.com/b/visualstudio/archive/2015/10/08/visual-studio-2015-update-1-ctp.aspx
Good luck... and happy interactive coding!
IWIH describes how to install it and which prerequisites you need.
Let me give you some
Additional information:
After you have installed VS 2015 and its updates (update 3 KB3165756 patch has just arrived) you can bring C# interactive to your screen as follows:
Either via the menu
View -> Other Windows -> C# Interactive
Or press Ctrl + Q and type into the quick launch box:
C# interactive
which allows you to click on View -> Other Windows -> C# Interactive
with the mouse.
Afterwards, you have the C# Interactive
beneath the error list. Here is an example how you can use it:
Quickstart:
- To get help in this window, type
#help
and press enter. - To execute a statement, simply press
ENTER
. To type in multiple lines, pressSHIFT+ENTER
for each line, and for the last line pressENTER
to execute the entire statement. - To print the values of a variable, type its name and press enter (in the screen shot, I have done this for variable
q
)