Running your app on a Raspberry Pi

Step 1

Flash 8GB SD Card with Raspbian Stretch (2018-11-13). BelenaEtcher is a nice tool for that.
Plug in the card and start the Raspberry Pi.
You can follow this guide, next steps are summarized below.

Step 2

    Install curl, libunwind8, gettext and apt-transport-https. The curl and apt-transport-https often are up-to-date.
1
sudo apt-get install curl libunwind8 gettext apt-transport-https
Copied!
    Download tar-ball.
1
curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.0.0/dotnet-runtime-latest-linux-arm.tar.gz
Copied!
    Unpack tarball to /opt/dotnet.
1
sudo mkdir -p /opt/dotnet && sudo tar zxf dotnet.tar.gz -C /opt/dotnet
Copied!
    Link dotnet binary.
1
sudo ln -s /opt/dotnet/dotnet /usr/local/bin
Copied!
Alternative: You can login as superuser (run "sudo su")
1
apt-get -y install curl libunwind8 gettext apt-transport-https
2
curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.0.0/dotnet-runtime-latest-linux-arm.tar.gz
3
mkdir -p /opt/dotnet && sudo tar zxf dotnet.tar.gz -C /opt/dotnet
4
ln -s /opt/dotnet/dotnet /usr/local/bin
Copied!
Note: Take care of line endings of the script. It should use LF instead of CR LF. Save the script as .sh file and run it on the Raspberry Pi with bash filename.sh.

Step 3

    To run an Avalonia application on Raspberry Pi you need to use this nuGet package:
1
https://www.nuget.org/packages/Avalonia.Skia.Linux.Natives/1.68.0.2
Copied!
It includes the libSkiaSharp.so.
    Now publish the app with the following command:
1
dotnet publish -r linux-arm -f netcoreapp2.0
Copied!
    Copy publish directory to the Raspberry Pi and run it with dotnet publish/ApplicationName.dll
Last modified 6mo ago
Export as PDF
Copy link