Quantcast
Channel: C#タグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 9289

Ubuntu18.04でC# Hello Worldメモ

$
0
0

概要

UbuntuでC#の開発をしたかったのでHello Worldしたメモ。

以下の記事を参考に自分で試してみたメモなので、これらの記事以上の内容はありません。

環境

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.3 LTS"

Install Mono

$ sudo apt -y install mono-devel
$ mono --version
Mono JIT compiler version 4.6.2 (Debian 4.6.2.7+dfsg-1ubuntu1)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           __thread
    SIGSEGV:       altstack
    Notifications: epoll
    Architecture:  amd64
    Disabled:      none
    Misc:          softdebug
    LLVM:          supported, not enabled.
    GC:            sgen
$ mcs --version
Mono C# compiler version 4.6.2.0

Ubuntu18.04でC# Hello World

HelloWorld.cs
usingSystem;publicclassHelloWorld{publicstaticvoidMain(){Console.WriteLine("hello world!");}}
$ mcs ./HelloWorld.cs
$ ls
HelloWorld.cs  HelloWorld.exe
$ mono ./HelloWorld.exe
hello world!
$ ./HelloWorld.exe
hello world!

まとめ

Monoを使えばUbuntuでC#の開発ができそう


Viewing all articles
Browse latest Browse all 9289

Trending Articles