.NET Core is an excellent cross-platform C# programming language framework.
.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:
-
Install icu-full-data package
opkg install icu-full-data
-
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
- Mkdir /usr/share/dotnet and decompress .NET Core
mkdir /usr/share/dotnet |
- Modify /etc/profile and add /usr/share/dotnet to PATH
Test console project:
Test webapi project:
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.