Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread Display Modes
Old Feb 22, 2012, 09:13 PM   #1
macrumors newbie
Join Date: Feb 2012
How to add C# to CodeRunner?

I want to add C# Language to CodeRunner

How to add it could you guys tell me in detail please

Thanks in advance
xEKx is offline   0 Reply With Quote
Old Feb 22, 2012, 11:01 PM   #2
macrumors G4
Join Date: Jul 2002
Location: USA
CodeRunner supports AppleScript, C, C++, Java, Objective-C, Perl, PHP, Ruby, and Shell Script. It does not support C#. If you want C# support in CodeRunner, then you should express your desires to CodeRunner's developer, Nikolai Krill.

As you are no doubt know, C# is a part of Microsoft's .NET frameworks. I am not aware of the value of C# outside the .NET frameworks. .NET does not exist on MacOS X. However, there is a clone of the .NET frameworks that should be fairly mature now. It is Mono 2.10.8.

In the best case--the one in which you can actually integrate C# with CodeRunner--you will need to download and install Mono.
Neither a borrower nor a lender be
For loan oft loses both itself and friend
William Shakespeare from Hamlet
MisterMe is offline   0 Reply With Quote
Old May 20, 2012, 09:58 AM   #3
David Sheeks
macrumors newbie
Join Date: May 2012
Configure C# on CodeRunner using mono

Configuring CodeRunner to compile and run C# is actually reasonably simple if you have Mono installed (if not, see http://www.go-mono.com/mono-downloads/download.html). Mono includes command line utilities to compile and run C# programs which by default are:

Compiler: /usr/bin/mcs
Runtime execution: /usr/bin/mono

To configure CodeRunner for C#, open the CodeRunner Preferences dialog, go to the "Languages" tab, click the "+" icon and and specify "C#" as the Language name. On the right you have fields where you can populate the language settings. Check the "Language uses compilation script" check box, enter "/usr/bin/mono $compiler" (no quotes) for the Run Command, set the File Extension to "cs" (again, no quotes). Click the "Edit Script..." button and append the following to the compile.sh script (this will open in the CodeRunner editor):

/usr/bin/mcs "$file"
if [ $status -ne 0 ]
exit $status
echo $file | sed -e "s/\.cs/.exe/"
exit 0
You can specify a code template like the following if desired:

using System;
public class MyProgram {
  public static void Main( string[] args ) {
    Console.WriteLine( "Hello, World!" );
CodeRunner doesn't have native syntax highlighting support for C#, but you can select Java as the syntax mode and the syntax highlighting works reasonably well since.
David Sheeks is offline   0 Reply With Quote

MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
When I add contacts into my iCloud/iPhone, any way to auto-add to Google Contacts? iHavequestions iCloud and Apple Services 4 Nov 26, 2013 04:01 PM
When to add RAM? 1972 iMac 14 Dec 7, 2012 04:13 PM
I need a script for CodeRunner to delete ".class" Fraaaa Mac Programming 0 Nov 7, 2012 07:31 PM
CNN: Math for Obamas budget does add up and could add 6.2 trillion to debt by 2022 glocke12 Politics, Religion, Social Issues 13 Oct 28, 2012 01:46 PM
Annoying add Robbietaylor Site and Forum Feedback 2 Jul 26, 2012 11:15 PM

Forum Jump

All times are GMT -5. The time now is 06:39 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2015, MacRumors.com, LLC