lang/cs/ HomePage


C Sharp

While C# is still mainly a Windows thing, it is available on Linux.

Windows

Linux

To install on Ubuntu 22.04 (from: https://orcacore.com/install-monodevelop-ubuntu-22-04/):

sudo apt update && sudo apt upgrade
sudo apt install dirmngr gnupg apt-transport-https ca-certificates software-properties-common
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
sudo apt-add-repository 'deb https://download.mono-project.com/repo/ubuntu stable-focal main'
sudo apt update
sudo apt install mono-complete mono-devel

and test with a trivial .cs file

using System;    
public class HelloWorld  {  
  public static void Main(string[] args)  {  
    Console.WriteLine ("Hello World!");  
  }  
}

which you compile via

csc hello.cs

and then run via

mono hello.exe
chmod a+x hello.exe
./hello.exe

Mac