As you might now, .NET Core 3.0 SDK and Runtime are available on Raspberry Pi (actually, any Linux ARM32 or ARM64 architectures, as well as x64). With the new 3.0 version of .NET Core you can run your console or ASP.NET Core web site\api projects on a cheap 35$ device without any problems (do not expect high performance).
We are using Raspberry Pi 3 to control our LinkedIn and Instagram automation (I will tell you about these projects when they are ready for public) via .NET Core console applications.
Let's prepare Raspberry Pi 3 to run any .NET Core application:
Install Raspbian
First of all, we need to prepare the Raspberry Pi device:
- Download Raspbian image
- Download Etcher to write this image to SD card
- Insert SD card into PC
- Open Etcher, select SD card and image, press "Flash!"
Install .NET Core 3.0 Runtime
After you are done with SD card, boot your Raspberry Pi and follow the initial configuration wizard.
Default login: pi
Default password: raspberry
Now you can open a browser and download the latest .NET Core Runtime (at the moment current version is 3.0.0-preview6) from the Microsoft website. You should select ARM32 version of the ASP.NET Core Binaries under Linux section.
When you are done with downloading do the following:
- Install prerequisites: sudo apt-get install curl libunwind8 gettext
- Extract downloaded archive: sudo mkdir -p /opt/dotnet && sudo tar zxf ARCHIVE_NAE.tar.gz -C /opt/dotnet
- Make dotnet visible to the system: sudo ln -s /opt/dotnet/dotnet /usr/local/bin
- Test it dotnet --version
Now you can publish your project with the ARM32 architecture, copy it to the device, make sure that file can be executed by running chmod +x name_of_project and run it with the ./name_of_project command