brettsalyer
Posts: 17
Joined: Fri Nov 30, 2012 1:56 am

C# Compiler for Raspbian

Thu Dec 06, 2012 2:58 pm

Hello, Im new to Linux and am learning C#. I want a compiler for my Pi. I have the Raspbian "wheezy" OS and found one that i think would work. Im not sure exactly what to get. Does anyone have any suggestions for a good C# compiler for me?

User avatar
bfagioli
Posts: 123
Joined: Sat Oct 27, 2012 11:49 pm

Re: C# Compiler for Raspbian

Fri Dec 07, 2012 4:00 am

I've been reading about Mono packages that include a CLR runtime and a C# compiler. I've not used Mono to develop code on the Pi but I have used Microsoft Visual Studio 2012 Express (free) to develop on a PC and then taken the .exe and run that on a Pi using the Mono runtime.

This seems to work fine for simple console applications in the current version of Raspbian "wheesy" hard float but anything more complex or even the simplest WinForm app fails imediately.

I'm not familiar with any other C# compilers but if you do the following package search things do pop up.

Code: Select all

sudo apt-cache search C#

or 
sudo apt-cache search CSharp

6677
Posts: 383
Joined: Wed Mar 14, 2012 9:23 pm

Re: C# Compiler for Raspbian

Sat Dec 08, 2012 10:15 pm

C# isn't a pure compiled language, it needs a virtual machine in order to run much like java which needs the jre/jvm in order to work. On windows this is the .net framework. There is an open source clone/implementation known as mono which works very very nicely on mac and linux usually but it has a few bugs on the pi (mostly its slower than it should be as it isn't hard float and its winforms implementation is screwed up), a dedicated rasbian build is on its way though.

You can safely compile .net 2.0, 3.0 and 3.5 applications and expect them to work on mono, same goes for 4 but some of 4 isn't fully implemented supposedly (never had an issue myself). Just remember to not use any windows specific libraries such as XNA. Your .exe from windows should work with mono on the pi once the stable version is out. You can also compile with the mono specific compiler like so: http://sixsixsevenseven.wordpress.com/2 ... udio-2010/

brettsalyer
Posts: 17
Joined: Fri Nov 30, 2012 1:56 am

Re: C# Compiler for Raspbian

Sat Dec 08, 2012 10:47 pm

Thanks!

User avatar
bfagioli
Posts: 123
Joined: Sat Oct 27, 2012 11:49 pm

Re: C# Compiler for Raspbian

Sun Dec 09, 2012 5:13 am

Do we have any idea when the Raspian hard-float specific Mono will be available?

I loaded the Rasbian soft-float distro just to do some testing and sure enough Mono does work much better there. My WinForm apps actually run so that's very cool but it is slow. I hope a hard-float specific build for the Raspian hard-float distro will be faster ... but just actually working is a good start :)

brettsalyer
Posts: 17
Joined: Fri Nov 30, 2012 1:56 am

Re: C# Compiler for Raspbian

Sun Dec 09, 2012 1:37 pm

Well, i don't know much about mono (me being new to Linux). Im used to Visual studios.

6677
Posts: 383
Joined: Wed Mar 14, 2012 9:23 pm

Re: C# Compiler for Raspbian

Sun Dec 09, 2012 3:35 pm

I assume hard float mono will come whenever its done. I have no idea. Once we have that then hopefully we'll have monogame coming along soon aswell (which I believe also had hard/soft float issues).

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: C# Compiler for Raspbian

Sun Dec 09, 2012 3:41 pm

6677 wrote:I assume hard float mono will come whenever its done. I have no idea. Once we have that then hopefully we'll have monogame coming along soon aswell (which I believe also had hard/soft float issues).
"hard float mono" sounds like a very nasty disease to catch.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

User avatar
bfagioli
Posts: 123
Joined: Sat Oct 27, 2012 11:49 pm

Re: C# Compiler for Raspbian

Sun Dec 09, 2012 6:15 pm

Joe Schmoe wrote:
6677 wrote:I assume hard float mono will come whenever its done. I have no idea. Once we have that then hopefully we'll have monogame coming along soon aswell (which I believe also had hard/soft float issues).
"hard float mono" sounds like a very nasty disease to catch.
Yea, it does ... and usually effects the "throat" not the "float" ;)

Return to “Other programming languages”