4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

らずぱいで .NET (mono)

Last updated at Posted at 2016-06-29

概要

  • .NET Core 1.0がリリース記念?
  • らずぱいで、いつつかえるようになるかわからんので、monoを使ってみる。
  • Installing Mono and ASP.NET on a Raspberry Pi を参考に、Hello World表示を
  • ポイント: そのまま sudo apt-get mono-completeやってしまうと、古いやつがインストールされてしまう

環境

  • Raspberry Pi 3
  • 2016-05-27-raspbian-jessie.img

手順

  1. sudo apt-get update; sudo apt-get upgrade -y; sudo apt-get install -y htop byobu
    ... いつもの

  2. Monoインストール

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install mono-complete
mono --version


    ```shell-session:monoバージョンチェック
pi@raspberrypi:~ $ mono --version
Mono JIT compiler version 4.4.1 (Nightly 4.4.1.0/4747417 Wed Jun 22 11:38:12 UTC 2016)
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
pi@raspberrypi:~ $ 
  1. Hello World
    • vi hello.cs

      hello.cs
      using System;
      
      public class HelloWorld
      {
          static public void Main ()
          {
              Console.WriteLine ("Hello World!");
          }
      }
      

    - ビルド・実行

        ```bash
# コンパイル.
mcs hello.cs
# 実行.
mono hello.exe
- 実行例

    ```shell-session

pi@raspberrypi:~ $ mcs hello.cs
pi@raspberrypi:~ $ mono hello.exe
Hello World!
pi@raspberrypi:~ $



## その他
- らずぱいでつくった、hello.exeは、Windowsでも、実行できました。
4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?