Posts: 128
Joined: Mon Oct 26, 2015 6:24 pm

Mono App will not Run on Start Up on my Raspberry Pi

Fri Dec 28, 2018 7:43 pm


I am awar ethis question has been asked here before but the solution did not work for me.

I originally put this into my rc.local:

mono /home/pi/MyFolder/app.exe

I have also tried the above with the full path to mono.

I have also put (both) into:


Nothing happens on reboot (do not know how to capture boot-up errors as the desktop is loaded.

If I run my app from desktop it works.

Anything else I can try (U have tried lots of things already)?

My app uses the camera.


Posts: 446
Joined: Fri Nov 03, 2017 4:36 pm

Re: Mono App will not Run on Start Up on my Raspberry Pi

Sat Dec 29, 2018 9:20 pm

If your program requires a display it would certainly fail under rc.local. To check if it needs a display, start an environment-less shell:

Code: Select all

env -i bash
and try your program within there.

Autostart is probably the right approach if your Pi user automatically logs in on boot, but one thing to be cautious of is that autostart is not actually a bash script. It's some other format that lists programs with the optional @ symbol. I recommend you make a script like so:

Code: Select all

cat <<EOF > /home/pi/MyFolder/
#!/bin/bash -x
mono /home/pi/MyFolder/app.exe >& /home/pi/MyFolder/logfile.txt
chmod u+x /home/pi/MyFolder/
Then you can list /home/pi/MyFolder/ in autostart, boot the Pi, look at the errors in logfile.txt, then troubleshoot and repeat.

Return to “Other programming languages”