Running C# in Sublime 3.0

Created by
Monday, August 22, 2016

Running C# in Sublime is quite a handy trick to pull out when you don’t feel like creating a whole project. Apart from the fact that sublime is a great text editor.



You are going to need to download and install the following.


Chocolatey - Chocolatey is a package manager for Windows (like apt-get or yum but for Windows).

To install Chocolatey you will need to run the following commands in powershell. There are alternative installation instructions provided on the Chocolatey website.

Ensure you are running Chocolatey as Administrator.

Execute the following command to set the execution policy to RemoteSigned.

Set-ExecutionPolicy RemoteSigned

Execute the following to download and install via powershell.

iex ((new-object net.webclient).DownloadString(''))    
iwr -UseBasicParsing | iex  

Once installed run the following to install ScriptCS.

choco install scriptcs 



Back in sublime you need to open your package manager. “Ctrl + Shift + P”. Once open type “Install Package”.

You will be taken to all available packages you wish to install. Find scriptcs and continue.

Under Tools navigate to Build System and set it to ScriptCs.

Open up an new file and set the syntax to C#. Save the new cs file wherever you wish. At this point you can now begin writing C# code. To execute the code in your console hit “Ctrl + B”.

And thats it! Running C# in sublime.

1 2 3 4 5