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

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

Hi,
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 23, 2012, 12:01 AM   #2
MisterMe
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, 10: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):

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

Code:
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

Reply
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 05:01 PM
When to add RAM? 1972 iMac 14 Dec 7, 2012 05:13 PM
I need a script for CodeRunner to delete ".class" Fraaaa Mac Programming 0 Nov 7, 2012 08: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 02:46 PM
Annoying add Robbietaylor Site and Forum Feedback 2 Jul 27, 2012 12:15 AM

Forum Jump

All times are GMT -5. The time now is 08:48 PM.

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

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