「マイクロソフト系技術情報 Wiki」は、「Open棟梁Project」,「OSSコンソーシアム .NET開発基盤部会」によって運営されています。
...と言う事で、以下、Rasbian上で、.NET Coreの開発を行う。
実際にやったログ
コチラ(Windows 10 IoT Core)で思い出す。
以下を参考に、Raspberry Pi 3 MODEL Bに.NET 5をインストール。
wget https://download.visualstudio.microsoft.com/download/pr/fada9b0c-202a-4720-817b-b8b92dddad99/fa6ace43156b7f73e5f7fb3cdfb5c302/dotnet-sdk-5.0.202-linux-arm.tar.gz
mkdir -p "$HOME/dotnet" && tar zxf dotnet-sdk-5.0.202-linux-arm.tar.gz -C "$HOME/dotnet"
sudo vi ~/.profile
export DOTNET_ROOT=$HOME/dotnet export PATH=$PATH:$DOTNET_ROOT
$ dotnet -v Unknown option: -v .NET SDK (5.0.202) 使用法: dotnet [runtime-options] [path-to-application] [arguments] ...
$ dotnet new console -o helloworld cd helloworld dotnet run
(.NET Core On Rasbian On Docker)
Rasbian上の.NET CoreのDockerコンテナで、helloworldをやってみる(た)。
dotnetapp
helloworld
docker build -t helloworld .
>docker images REPOSITORY TAG IMAGE ID ... helloworld latest XXXXXXXX ...
docker run helloworld Hello World!
docker tag XXXXXXXX osscjpdevinfra/helloworld:latest
>docker login Authenticating with existing credentials... Login Succeeded
>docker push osscjpdevinfra/helloworld:latest
>docker rmi XXXXXXXX -f ... Deleted: sha256:...・Docker Hubからプルして実行。
>docker run osscjpdevinfra/helloworld:latest Unable to find image 'osscjpdevinfra/helloworld:latest' locally latest: Pulling from osscjpdevinfra/helloworld ... Status: Downloaded newer image for osscjpdevinfra/helloworld:latest Hello World!
$ docker run osscjpdevinfra/helloworld:latest Unable to find image 'osscjpdevinfra/helloworld:latest' locally latest: Pulling from osscjpdevinfra/helloworld ... Status: Downloaded newer image for osscjpdevinfra/helloworld:latest WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm/v7) and no specific platform was requested standard_init_linux.go:219: exec user process caused: exec format error
>docker run osscjpdevinfra/helloworld:net50-debian-arm32 WARNING: The requested image's platform (linux/arm) does not match the detected host platform (linux/amd64) and no specific platform was requested A fatal error occurred, the folder [/usr/share/dotnet/host/fxr] does not contain any version-numbered child folders
$ docker run osscjpdevinfra/helloworld:net50-debian-arm32 Unable to find image 'osscjpdevinfra/helloworld:net50-debian-arm32' locally net50-debian-arm32: Pulling from osscjpdevinfra/helloworld ... Digest: sha256:558763682161963dfc72879e17220ae62e0767b7727261a4219de840cf3c1439 Status: Downloaded newer image for osscjpdevinfra/helloworld:net50-debian-arm32 Hello World!
$ docker build -t helloworld:hoge . ... Successfully tagged helloworld:hoge
$ docker run helloworld:hoge Hello World!
本格的な開発のため、Visual Studio Code環境を作ってみる。
$ sudo apt update $ sudo apt install code
The C# extension for Visual Studio Code (powered by OmniSharp) is incompatible on linux armv7l
※ ...と言う事で、現時点の結論としては、OmniSharpのARM対応待ち。
GUIに関しては、
https://codezine.jp/article/corner/606
https://codezine.jp/article/corner/792
Tags: :インフラストラクチャ, :IoT, :Linux, :.NET開発, :.NET Core