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

.NET Core is an excellent cross-platform C# programming language framework. :grin:
.NET Core framework not only supports Debian, but also OpenWRT.
Same as Debian, it also support .NET Core 8.0 and 9.0.

There are two differences between the OpenWRT version and the Debian version.
First, OpenWRT must use the Arm64 Alpine version of .NET Core.
Second, OpenWRT must install the icu-full-data package.

Install step:

  1. Install icu-full-data package
    opkg install icu-full-data
    image

  2. Download .NET Core From Microsoft

wget https://builds.dotnet.microsoft.com/dotnet/Sdk/8.0.408/dotnet-sdk-8.0.408-linux-musl-arm64.tar.gz

  1. Mkdir /usr/share/dotnet and decompress .NET Core
mkdir /usr/share/dotnet
cd /usr/share/dotnet/
tar zxf /tmp/dotnet-sdk-8.0.408-linux-musl-arm64.tar.gz

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

Test console project:
image

Test webapi project:
image

Modify appsettings.json, change binding localhost to 0.0.0.0.

Run it.

PS:
OpenWRT has a firewall enabled by default, which will cause the webapi server unable to connect.
I only use it(OpenWRT) as a WiFi AP, so I turned off the firewall. image

1 Like