1.21 jigowatts

Great Scott!

Visual Studio for Mac をインストールしてHello World!

概要

だいぶ乗り遅れましたが、Visual Studio for Macをインストールして.NET CoreのコンソールアプリでHello World!までやってみました。

f:id:sh_yoshida:20161215070253g:plain

環境

macOS Sierra バージョン 10.12.1

ダウンロードは以下から。
https://www.visualstudio.com/vs/visual-studio-mac/

f:id:sh_yoshida:20161215055518p:plain

ダウンロードが完了したら、インストーラーを起動します。

f:id:sh_yoshida:20161215060349p:plain

インストール

流れるような動作でインストール(スクリーンショット貼っておきます)。
f:id:sh_yoshida:20161215060713p:plain
f:id:sh_yoshida:20161215060733p:plain
f:id:sh_yoshida:20161215060748p:plain
f:id:sh_yoshida:20161215060848p:plain
f:id:sh_yoshida:20161215060810p:plain
少し時間がかかりそうだったので放置(開始したのが夜)して寝ましたzzz
で、朝起きたらエラー...
f:id:sh_yoshida:20161215061127p:plain
その後、最小構成にして2,3回やり直してみたけど毎回Android SDKのダウンロードの途中で止まっちゃう!
f:id:sh_yoshida:20161215062128p:plain
さらにしつこくやり直して(5回目くらいで)やっとインストールできましたhehe
f:id:sh_yoshida:20161215061837p:plain

Hello World!

さて、なんとかインストールできたので動かしてみます。
f:id:sh_yoshida:20161215062738p:plain
.NET Coreのコンソールアプリケーションプロジェクトを選択。
f:id:sh_yoshida:20161215062813p:plainf:id:sh_yoshida:20161215062925p:plain
f:id:sh_yoshida:20161215063217p:plain

実行

そのまま実行してみました。
えっ?!まさかのエラー!
コンソールに吐き出されたメッセージは.NET Core Appのバージョン1.0.1が見つからないと。

The specified framework 'Microsoft.NETCore.App', version '1.0.1' was not found.
  - Check application dependencies and target a framework version installed at:
      /usr/local/share/dotnet/shared/Microsoft.NETCore.App
  - The following versions are installed:
      1.0.0
      1.0.0-rc2-3002702
      1.1.0
  - Alternatively, install the framework version '1.0.1'.

Press any key to continue...

デフォルトの.csprojには.NET Core Appのバージョンが1.0.1って書かれてるけどインストールされてなくて怒られたのかな。
現時点(2016/12/15)では1.1.0が最新ですね。
https://www.microsoft.com/net/core

f:id:sh_yoshida:20161215063341p:plain
.csprojを書き換えて、[プロジェクト]-[NuGetパッケージの復元]。
f:id:sh_yoshida:20161215063707p:plain

ただHello World!表示するのもアレなんでとりあえず流しておきました┗(^0^)┓三3

f:id:sh_yoshida:20161215070253g:plain

C#流れるHello World!