Do you know any nice interface for C# Interactive standalone? - c#

You can open the C# Interactive window in Visual Studio to use C# as a scripting an shell language. Unfortunately, this requires you to have Visual Studio open all the time.
I know I can run csi.exe itself, but this does not give me any syntax highlighting or auto completion features.
How can I run the C# Interactive Windows standalone?

I would suggest LINQPad (I don't use it myself but I know this can do that kind of things). I think it's pretty powerful
https://www.linqpad.net/

VSCode has built in support for .NET Interactive Notebooks - if you don't see it, you can install the '.NET Interactive Notebooks' extension

Related

C# Interactive in Visual Studio Community on Mac

I'm trying to do some treehouse tutorials on C#. Unfortunately, the instructor is teaching this course in an windows machine with a windows version of VS Community while I follow along VS Community for mac. Got to a point where she is trying to use the C# interactive (REPL) but I can't seem to find it on the mac version. Anyone know if its even possible to do this on the mac? Thanks.
You can't run it in Visual Studio. You can, however, use the terminal.
When you install mono the command csharp gets installed as well.
Simply type csharp and the terminal will become a C# interactive window.
If you have Mono installed you can also use: csi
No Interactive Window support in VS 2017 Mac.
Future versions may have this feature. If it is important you could use Parallels and run the Windows version.
Or work around it by doing the same sorts of things with a debugger and Immediate Window.
Use Xamarin Workbooks!
If you don't like Xamarin Workbooks for whatever reason, you can also use csi in the console, but it doesn't have code completions :/ I couldn't edit Sachin's answer above, but to be more clear, all you need to do is open the terminal and type csi to start the C# interactive tool. Of course this only works after you've installed Visual Studio (it should have installed Mono in the process).

How do I get console application window in C#?

I am getting started on C# and installed Microsoft blend for visual studio and my newproject window looks like below.
I am looking for console application as shown in below screeshot,how do I get it?
EDIT1:
how do I launch visual studio IDE?
Use Visual Studio, not Blend, to create a new Console Application.
More info on Blend and it's uses.
Blend is an interface design tool and therefore can't be used to build console apps... Try Visual Studio Community instead.
Just going along with what everyone else is saying, Visual Studio 2015 COMMUNITY EDITION is free to download and fully featured. Great tool, if anything it has too many uses. I believe it may even have most of the Visual Basic features built in.
https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx
From the Microsoft Blend Website:
Microsoft Expression Blend is a full-featured professional design tool for creating engaging and sophisticated user interfaces for Microsoft Windows
Which a console application is not; is has basically no UI. You should keep on using Visual Studio for console application.
You can likely make the console window appear in almost any application simply by using Console.WriteLine you can also create an arbitrary console by launching one:
Is there a way to create a second console to output to in .NET when writing a console application?
Legacy Services were default are not User Interactive and thus have no console easily viewable..

C# plugin for Eclipse

Is there a good working plugin for C# in Eclipse? I'm using a Linux machine so I do not have access to Visual Studio Express. I already have an Eclipse Environment working perfectly for my needs so I don't want to deal with multiple IDEs if at all possible. It doesn't need code complete but highlighting and compiling would be nice.
Emonic is an actual eclipse plugin for C#: http://emonic.sourceforge.net/.
Here's a handy guide for how to get it set up: http://www.ibm.com/developerworks/library/os-eclipse-migratenetvs/
Monodevelop is great, but won't meet your requirement not to have to work in multiple IDEs.
I'm not sure about eclipse, but MonoDevelop is cross platform.
http://monodevelop.com/
From:
http://www.mono-project.com/Mono_For_Linux_Developers#Eclipse_in_C.23_Mode
Black-Sun
Emonic
eSharp
I don't personally have any experience with the mentioned plugins. Any C# development I've done on Linux has been through MonoDevelop
From Eclipse marketplace:
aCute: C# edition in Eclipse IDE
aCute enables C# application development in the Eclipse IDE.
aCute provides a rich C# editor with error reporting, hover, content assist, jump to references... (using OmniSharp) and syntax highlighting (using TextMate grammar).
aCute also integrates various operations of the dotnet command-line (New, Run, Test, Publish) as typical Eclipse IDE wizards and workflows.
aCute provide supports debugging for .NET applications.

Is there an Eclipse C# Highlight, Code Completion plugin

I need an Eclipse 3 plugin for C# syntax highlight and hopefully code completion.
I am running both Mac and Windows versions of Eclipse.
I have evaluated "Improve C#" but it seems to be not working.
Have a look at Emonic. It is an Eclipse plug-in which allows you to build C# programs with Mono or Microsoft .NET.

Anders Hejlsberg's C# 4.0 REPL

During the last 10 minutes of Ander's talk The Future of C# he demonstrates a really cool C# Read-Eval-Print loop which would be a tremendous help in learning the language.
Several .NET4 related downloads are already available: Visual Studio 2010 and .NET Framework 4.0 CTP, Visual Studio 2010 and .NET Framework 4 Training Kit. Do you know what happened to this REPL? Is it somewhere hidden among examples?
I know about mono repl. Please, no alternative solutions.
The REPL demo was part of "what might happen next", i.e. after 4.0; in .NET 5.0 or something similar.
This is not 4.0 functionality, and never has been.
It's probably worth mentioning that the Mono project already does have a C# REPL which i tend to use for those small checks you do now and then. Take a look. Also, if I'm testing an idea which I'm uncomfortable Mono is going to handle to well and it's not worth starting a new test project then Snippet Compiler always comes in handy.
The Immediate window (Debug>Windows>Immediate Ctrl+D, I ) is fairly good replacement that's built in. It does require you start the IDE and put a breakpoint on something.
It does give you the context of where you would like to do experimentation.
Marc's answer is entirely correct, the possibility of a repl or script like c# has been discussed by Eric Lippert in two blog posts:
Why doesn't c# implement top level methods
It already is a scripting language
I would add that, the 2010 CTP does contain an f# repl (not much use for c# but if you were interested in some aspect of the BCL or CLR then it might be sufficient for your needs)
I find that LINQPad makes up for the lack of a REPL in many cases. It would be nice to get it integrated into Visual studio so you could interact with your existing code base more easily though.
Take a look at this C# REPL Script Environment which is a great way to quickly run C# script (and learn how to code)
I just published a VisualStudio Extension that provides a REPL environment inside VisualStudio (namely a C# REPL Environment with a Fluent API for .NET and VisualStudio)
In addition to being able to write and execute quick C# snippets (in a REPL environment), you can program VisualStudio IDE in real time!
You can install it using VisualStudio's Extension Manager (search for C# REPL) or via the download link at the VisualStudio Gallery page: VisualStudio C# REPL
The VisualStudio C# REPL page also contains more details and code samples.
There is also an Reddit thread on this extension (which contains more code samples).
Let me know what you think of it
Command-line REPL
To play with the C# REPL outside of Visual Studio, open the Developer Command Prompt for VS2015 and type the command csi to begin your interactive session. Here is a list of arguments that can be passed to csi.
Note: csi stands for "CSharp Interactive"
You can also open an interactive window directly from Visual Studio by navigating to View > Other Windows > C# Interactive.
Check out the Roslyn Wiki on the C# Interactive Window.
I found http://kamimucode.com/Home.aspx/C-sharp-REPL/1 . Which seems to be pretty good and I believe also exposes an API to evaluate expressions dynamically
To update on this old question c# REPL is now available as part of Visual studio IDE (starting VS 2015 update 1).
Introducing the Visual Studio 'C# REPL'
From time to time I want to try out some .NET API instead of wondering about C# language syntax. (There are far more subtleties in API than in the language itself.) If you are only looking for REPL for .NET, good old PowerShell is always with you.
C#:
using System;
using System.Text;
Convert.ToBase64String(Encoding.UTF8.GetBytes("Overflow"));
PowerShell:
[Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes("Overflow"))

Categories