雛形プロジェクトを作成して実行する。
成果物
情報源
- https://dotnet.microsoft.com/learn/dotnet/hello-world-tutorial/create
- https://dotnet.microsoft.com/learn/dotnet/hello-world-tutorial/run
- https://dotnet.microsoft.com/learn/dotnet/hello-world-tutorial/edit
プロジェクト作成
dotnet new console -o myApp cd myApp
dotnet new
に20秒もかかった。個人情報の搾取はされていないはずなのに、なぜこれほど遅いのか……。
dotnet new console -o myApp
The template "Console Application" was created successfully. Processing post-creation actions... Running 'dotnet restore' on myApp/myApp.csproj... /tmp/work/myApp/myApp.csproj の復元が 568.37 ms で完了しました。 Restore succeeded.
自動生成されたコード
Program.cs
using System; namespace myApp { class Program { static void Main(string[] args) { Console.WriteLine("Hello World!"); } } }
実行
dotnet run
Hello World!
初回実行に52秒もかかった。2回目で13秒。嘘だろ。遅すぎ……。
編集
Console.WriteLine("Hello World!"); Console.WriteLine("The current time is " + DateTime.Now);
DateTime.Now
の行を追記。そして実行。
dotnet run
Hello World! The current time is 2019/10/16 7:59:05
所感
アクション | 所要時間(秒) |
---|---|
プロジェクト生成 | 20 |
ビルド&実行 | 52 |
実行 | 13 |
遅すぎ……。
対象環境
- Raspbierry pi 3 Model B+
- Raspbian stretch 9.0 2018-11-13 ※
- bash 4.4.12(1)-release ※
- SQLite 3.29.0 ※
- C# dotnet 3.0.100
$ uname -a Linux raspberrypi 4.19.42-v7+ #1218 SMP Tue May 14 00:48:17 BST 2019 armv7l GNU/Linux