I want to learn C# on a Debian system.

What do I have to install?

Is there something like an interactive prompt where I can try running snippets of code?

I have to learn C# and I have a dual boot computer, but don't feel like powering off Linux and booting Windows just for learning C#.

  • 1
    Hey, why all the negative votes? Is that because it's a question about a MS technology? – Pierre B Nov 26 '17 at 18:45
  • 3
    I have edited it not to look like a request for learning materials (which is what it's getting close votes for). – Michael Homer Nov 26 '17 at 18:46

What do I have to install?

apt install mono-mcs

and optionally

apt install monodevelop

if you want something more like an IDE.

mcs is the compiler. You can run the compiled program with mono prog.exe (or as ./prog.exe with binfmt_misc support enabled, which I believe Debian will do by default).

Is there something like a prompt where I can try running snippets of code?

apt install mono-csharp-shell

and then

$ csharp
Mono C# Shell, type "help;" for help

Enter statements below.
csharp> Console.WriteLine("Hello world!")
Hello world!

To complement the previous answer, there's also the .NET Core SDK, which is has a faster and cleaner implementation of the .NET framework(albeit it's somewhat imcomplete, being a Core CLR. Still really reliable, though). If you don't need C# for WinForms, UWP and WPF development, I really recommend checking it out. By now, most libraries should be supporting .NET Core. Download link: https://dotnet.microsoft.com/download

As for the IDE, there's VS Code, which is the one I'm currently using, and JetBrains Rider. MonoDevelop does have an addon for NET Core support, but I heard it's lacking features(especially on the debug department).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.