ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

C# Compile & Run

by chrokh ALL

Build and run single C# files from Sublime Text 2.

Details

  • 2016.10.18.09.30.03
  • github.​com
  • github.​com
  • 4 years ago
  • 3 hours ago
  • 8 years ago

Installs

  • Total 33K
  • Win 25K
  • Mac 4K
  • Linux 3K
Jan 23 Jan 22 Jan 21 Jan 20 Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13 Jan 12 Jan 11 Jan 10 Jan 9 Jan 8 Jan 7 Jan 6 Jan 5 Jan 4 Jan 3 Jan 2 Jan 1 Dec 31 Dec 30 Dec 29 Dec 28 Dec 27 Dec 26 Dec 25 Dec 24 Dec 23 Dec 22 Dec 21 Dec 20 Dec 19 Dec 18 Dec 17 Dec 16 Dec 15 Dec 14 Dec 13 Dec 12 Dec 11 Dec 10 Dec 9
Windows 7 8 7 11 5 13 11 9 8 11 17 15 6 10 13 11 10 15 8 9 6 12 3 6 8 4 8 2 8 8 4 6 13 11 8 9 7 6 12 8 7 4 9 8 7 8
Mac 0 0 0 0 1 1 0 0 0 2 4 3 1 1 1 1 3 0 1 1 1 0 0 2 1 1 1 1 1 1 0 0 2 2 3 0 0 1 1 0 1 2 2 1 0 1
Linux 1 0 0 1 2 1 1 0 1 0 0 0 3 0 0 0 0 2 2 0 2 4 0 2 2 1 2 1 1 1 1 1 0 0 1 1 0 0 2 2 1 2 2 1 0 1

Readme

Source
raw.​githubusercontent.​com

Build and run single C# files from Sublime Text 2 on OSX and Windows.

Usage

With any *.cs file open. - Cmd + b Compile filename.cs into filename.exe in current folder and output errors - Shift + Cmd + b Run filename.exe in current folder

About

The aim of this plugin is to provide easy and fast and overhead-free access to the C# language. Without having to load heavy applications such as Visual Studio or Xamarin. This plugin provides a C# sandbox (usable for schools or other learning environments) and is not intended to be used to build production applications.

Dependencies

  • Assumes you have mcs and mono commands available in your PATH. For Windows you should have csc in your PATH. If you have previously installed Xamarin Studio or Mono Develop you should have these available in your path. If you don't please read more at here or here

  • SublimeFixMacPath (for Mac users) . Required because of updates to Mac OS. Enables Sublime to load your PATH variable.

Installation

Using Package Manager (recommended)

You can now install the C# build system through the package manager channel. The package is called “C# Compile & Run”

The old-school way

  1. cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/
  2. git clone git@github.com:ChrOkh/chsharp-build-singlefile-sublime-text-2.git CSharpSinglefile

Code-completion

If you want Visual Studio-style code completion, be sure to also install the awesome plugin CompleteSharp (available via package manager)

Example

Now we can write minimalistic C# console applications:

using System;
class MainClass{
  public static void Main(){
    Console.WriteLine("Hello world");
  }
}