DEV Community

Discussion on: Learn how to build .NET Core IoT apps for Raspberry Pi Linux, and connect to Azure IoT Hub

Collapse
 
ericvdb profile image
EricVdB

I followed this guide and its working perfect, but now i'm stuck at making my app a service on the pi.

Adding this as a service is quite simple:
create a appname.service in /etc/systemd/system/
with the following contents:

[Unit]
Description=AppName

[Service]
ExecStart=/bin/dotnet /home/pi/dotnet.core.iot.csharp/dotnet.core.iot.csharp.dll
WorkingDirectory=/home/pi/dotnet.core.iot.csharp

but i can't find the path to dotnet.

Any idea?

Thanks in advance,
Eric

Collapse
 
gloveboxes profile image
Dave Glover • Edited

Are you just trying to run the program on startup or do you need to run as a service for some reason? The app is standalone, you've not installed the standalone dotnet framework. The easiest way to autostart an app is to add to /etc/rc.local with an & after the command to allow app to run in the background.