Developer(s) | Fabrice Bellard |
---|---|
Stable release | |
Repository | repo.or.cz/w/tinycc.git |
Written in | C and Assembly[citation needed] |
Operating system | Linux, Unix, Windows |
Type | |
License | LGPLv2.1 |
Website | bellard.org/tcc/ |
C:/Windows/Microsoft.NET/Framework
, inside you’ll see a bunch of folders with version names. Navigate to the version number that you want to work with (I always choose 4.x) and copy the absolute path of the folder by clicking on the address bar and copying its contents.Win + R
and type cmd
, then click on Run) and type in csc
, if it says that the command isn’t recognized, you’re doing things wrong. Install the .NET Framework if you haven’t, localize the direct path to the latest version where the csc.exe executable is and copy the path, then follow the PATH variable instructions here from HowToGeek. Otherwise, you’ll be welcomed with the Microsoft C# Compiler and it’s copyright details..exe
is optional), hit ENTER
and you’ll see your console output! CSC has some options that you can use, for example, the file wildcard for compiling more than one C# files into a single executable by substituting source_file.cs
with *.cs
, also, refer to the documentation.ENTER
):hello.cs
by typing touch hello.cs
or editing directly into VIM or Nano and then save the file. Here are the contents of said file:hello.cs
. If the compiler has no warnings or errors to tell you about, you won’t see any output, why don’t you try to remove the semicolon from line 5 on the file? It will output something like this:; expected
which is pretty self-explanatory. If you want to see all the options available in the compiler, why don’t you head up to the official documentation? One last tip, if you want to compile all the files in a folder you can use the wildcard mcs -out:my-program.exe *.cs
asterisk.mono
command will allow you to execute the code we just created in the terminal or even a desktop GUI app (for web apps, that’s a whole different shabang). Open the terminal if you closed it by accident and navigate to the directory where the C# file was. Now, execute the following command:OmniSharp
. If you’re running Atom (the experience is more pleasant here) you can install the package with the same name omnisharp-atom
(via the app or using apm). For more information go to the official website or watch this video. For Omnisharp to work you need Mono 3 dot something and bigger, I am running the 4th version and still couldn’t get it to work on Elementary OS, I’m not sure if I’m stupid or if I am missing something but I really hope you can get it to work because it’s a blessing because it provides IntelliSense, errors and warnings, code autocompletion and more.csharp
in the terminal if you have Mono installed and enjoy!CTRL/CMD + B
key combination (or going to Tools > Build).Tools
menu and hit the Build System
submenu, then click on New Build System...
. You will be received with a new file that looks like a JSON literal, change the content of that file with this:csharp.sublime-build
in the suggested directory and now go to a c# file with Sublime Text, navigate to the Tools > Build
submenu and click the “csharp” checkmark, now when you execute the Build
command (CTRL/CMD + B
) you’ll see a mini window down below like this:csc
as its default command for executing C# code.