This is a sample project to demonstrate how to use .NET 8 AoT Minimal API with Raspberry Pi 3B+.
- Raspberry Pi 3B+ with Raspbian OS (Legacy, 64bit) Lite
- .NET 8 SDK
- Docker and Visual Studio Code with Dev Container extension
- Clone this repository
- Open this repository with Visual Studio Code
- Open workspace with Dev Container
- Run
dotnet publish -c Release
- copy
./bin/Release/net8.0/linux-arm64/publish/
to Raspberry Pi - Run
./rpi
on Raspberry Pi
This is a sample service file to run rpi
on Raspberry Pi as a service on boot.
- Edit
run-api.service
to replaceExecStart
andWorkingDirectory
with the path torpi
- Copy
run-api.service
to/etc/systemd/system/
and runsudo systemctl daemon-reload
to reload the service. - Run
sudo systemctl enable run-api.service
to enable this service. - Run
sudo systemctl start run-api.service
to start this service without rebooting. - Run
sudo systemctl status run-api.service
to check the status of this service. - Run
journalctl -u run-api.service
to check the logs of this service.