Mono on Raspberry Pi

2019-01-29 20:41发布

I've seen a lot of talk about running Mono/.NET code on the Raspberry Pi. Has there been any success in actually running any Mono code on a Raspberry Pi?

On their site, they list several Linux distributions that work on the device and some of these distributions include Mono. However, none detail whether Mono works on it.

Is there a working implementation?

9条回答
疯言疯语
2楼-- · 2019-01-29 21:09

I have managed to run my Delta Forth .NET compiler on Debian 6.0 (Squeeze) and Mono. It worked flawlessly with full binary compatibility, the only thing I had to do was to recompile the code to target .NET 3.5 (instead of 4.0) since Mono on Debian lags a bit regarding .NET versions.

The compiler is not a trivial .NET application so I was happy to actually see the compiler in action on my tiny Raspberry Pi.

The actual steps I took to make the magic happen were (I recall from memory):

  • Install the Mono runtime using: sudo apt-get install mono
  • Invoke the compiler itself using: mono DeltaForth.exe file_to_compile.4th

That is all. The most challenging part of this endeavor was to transfer the files from my Windows machine to Raspberry Pi using a flash drive :-)

查看更多
对你真心纯属浪费
3楼-- · 2019-01-29 21:09

The folks on the Raspberri Pi board are reporting that Mono does indeed work, at least for simple applications.

查看更多
男人必须洒脱
4楼-- · 2019-01-29 21:11

I was able to run WCF service with EntityFramework consuming MySql database installed on Pi. It was just a test project, but performance was good.

查看更多
可以哭但决不认输i
5楼-- · 2019-01-29 21:13

Yes. I've successfully run Mono based Winforms and Webforms apps (XSP). Detailed How to is available in my blog

http://www.amazedsaint.com/2013/04/hack-raspberry-pi-how-to-build.html

查看更多
混吃等死
6楼-- · 2019-01-29 21:14

Hard float support is now in mono 3.2.7:
http://www.raspberrypi.org/phpBB3/viewtopic.php?t=62496&p=468500

The latest source can be installed from git. It should be something like this:
(remove previous mono installations first)

sudo apt-get update
sudo apt-get install git build-essential automake autoconf libtool gettext
git clone git://github.com/mono/mono.git
cd mono
./autogen.sh --prefix=/usr/local
make get-monolite-latest
make EXTERNAL_MCS="${PWD}/mcs/class/lib/monolite/gmcs.exe"
sudo make install

This is how "mono -V" looks like on my raspberry:

Mono JIT compiler version 3.4.0 (master/ae165c5 Thu Mar 13 01:20:37 UTC 2014)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           __thread
    SIGSEGV:       normal
    Notifications: epoll
    Architecture:  armel,vfp+hard
    Disabled:      none
    Misc:          softdebug
    LLVM:          supported, not enabled.
    GC:            sgen

A quick test seems to work fine:

csharp> Math.Pow(2,4);
16
查看更多
叛逆
7楼-- · 2019-01-29 21:24

On my Raspberry Pi running the Fedora 18 remix, all I needed was:

    # yum -y install mono-devel

To Check:

    # csharp
    Mono C# Shell, type "help;" for help
    Enter statements below.
    csharp> Console.WriteLine("Hello, I am PI");
    Hello, I am PI
    csharp>  
查看更多
登录 后发表回答