Page 1 of 1

C# Compiler for Raspbian

Posted: Thu Dec 06, 2012 2:58 pm
by brettsalyer
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?

Re: C# Compiler for Raspbian

Posted: Fri Dec 07, 2012 4:00 am
by bfagioli
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

Re: C# Compiler for Raspbian

Posted: Sat Dec 08, 2012 10:15 pm
by 6677
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/

Re: C# Compiler for Raspbian

Posted: Sat Dec 08, 2012 10:47 pm
by brettsalyer
Thanks!

Re: C# Compiler for Raspbian

Posted: Sun Dec 09, 2012 5:13 am
by bfagioli
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 :)

Re: C# Compiler for Raspbian

Posted: Sun Dec 09, 2012 1:37 pm
by brettsalyer
Well, i don't know much about mono (me being new to Linux). Im used to Visual studios.

Re: C# Compiler for Raspbian

Posted: Sun Dec 09, 2012 3:35 pm
by 6677
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).

Re: C# Compiler for Raspbian

Posted: Sun Dec 09, 2012 3:41 pm
by Joe Schmoe
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.

Re: C# Compiler for Raspbian

Posted: Sun Dec 09, 2012 6:15 pm
by bfagioli
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" ;)