C# & Uncategorized 22 May 2007 07:16 pm
C# on Mac OS X
Turns out it’s a snap to start developing with C# on Mac OS X. The hard work is already done for you. First, download and install the latest Mono framework binary for OS X.
This blog from Brian Ray gives a nice Hello World example. The gist is:
- Compile with “/Library/Frameworks/Mono.framework/Commands/mcs hello.cs”
- Run with “/Library/Frameworks/Mono.framework/Commands/mono hello.exe”
TextMate fans can have it even easier. This close-to-anonymous C# TextMate bundle gives us the basics, including syntax coloring and some handy tab-completions. Install it by unzipping it and opening the bundle file. TextMate will install it for you.
To add a Run command, open the TextMate Bundle Editor, select the crisp new C# bundle, and add a New Command to it.
EXE_FILE=`echo $TM_FILEPATH | sed -e 's/\..*$//'`.exe
/Library/Frameworks/Mono.framework/Commands/mcs $TM_FILEPATH
/Library/Frameworks/Mono.framework/Commands/mono $EXE_FILE
Then, write your code and hit Cmd-R to compile and run the current source file. Snap!
One Response to “C# on Mac OS X”

on 13 Jun 2009 at 4:16 pm 1.Brain Reset said …
C#, a new scripting language ?…
Honestly I wasn’t a fan for C#, it’s a new language, and can do a lot of fun things, but anyway at work I have to stick with Fortran and matlab, at home I uses c++ and python. Besides, I am a mac person now, I thought there’s no way i…