[BPI-R4] .NET Core on BPI-R4 (Debian version)

.NET Core is an excellent cross-platform C# programming language framework.
We can install the compilation and execution environment on BPI-R4 Debian.

First of all, BPI-R4’s Debian supports .NET Core 8.0 and 9.0, and you can install either or both.

Install step (Here we example .NET Core 8.0):

  1. Download from Microsoft .NET

We download Arm64 version Binary.

  1. Mkdir and decompress .NET to /usr/lib/dotnet
cd /tmp
wget --no-check-certificate https://builds.dotnet.microsoft.com/dotnet/Sdk/8.0.408/dotnet-sdk-8.0.408-linux-arm64.tar.gz
mkdir /usr/lib/dotnet
cd /usr/lib/dotnet
tar zxf /tmp/dotnet-sdk-8.0.408-linux-arm64.tar.gz

  1. Modify /etc/profile and add /usr/lib/dotnet to PATH

After installed, we can create project to test.

Console project test:

mkdir /tmp/test_console
cd /tmp/test_console
dotnet new console
dotnet run

image

API Web project test:

cd /tmp
mkdir test_webapi
cd test_webapi
dotnet new webapi -f net8.0

dotnet run

image

PS: .NET webapi default binding localhost, we can modify appsettings.json to change this.