Raspberry Pi install C # runtime environment

A. Installation mono

The ARMv6 (generation Raspberry Pi B +): http://yunpan.cn/cw6NYzXkD9kHq access password 63Ae
the ARMv7 (II Raspberry Pi 2): http://yunpan.cn/cw6NMKUztiSDu access password 4efb

1. Download the file mono_4.0.1-1_arm7hf.deb

2. filezilla tool to incoming / home / pi directory

3. In the SSH input terminal: i.e. as shown in FIG mounted mono_4.0.1-1_arm7hf.deb completed sudo dpkg -i

 

OK, now to write a test it helloword

 

nano hello.cs

 

Enter the code

 

using System;

public class HelloWorld
{
    static public void Main ()
    {
        Console.WriteLine ("Hello World");
    }
}

 

 

Compile hello.cs

mcs hello.cs

Compile successfully generates hello.exe, use the file command to view file properties and found that Intel architecture, running on MS Windows platforms. Why is this?
We know that C # is a dynamic language, he relies on CLR (Common Language Runtime) to explain the run, while CLR is platform-dependent, he is responsible for running hello.exe.

 

 

Well, let's run the test

mono helle.exe

Success output Hello World

 

 

 

In fact, we can copy files directly to the windows hello.exe executed. Note that in XP you need to install the .NET environment, windows 7 comes with the .NET environment, does not require installation.
Here I will hello.exe put under the table, enter the command line interface, run directly hello.exe, successful output Hello World
is not it amazing?

Write once, run everywhere!


 

Thus mono installation environment, this time without performing only mono exe program interface, the interface needs to be installed to support it GTKSharp (Mono or .NET-based tool graphical user interface package)

 

II. Online install mono

1. Online download and install mono:

 

sudo apt-get install mono-complete

2. Download and install STK-Charp online library:

 

sudo apt-get install libglib2.0-dev

 

Source: https://blog.csdn.net/wanxuncpx/article/details/50778006

Guess you like

Origin www.cnblogs.com/mq0036/p/11140961.html