You can't do it: the service does not run under a user account - which is why you can't display anything to a user: no user, no user interface.
So
shutdown -l
looks at the current user that the service operates as, doesn't find one, and does nothing.
It works in debug because debugging a service is a special case, with a lot of care needed:
How to: Debug Windows Service Applications[
^]
Basically, you can't force a user logoff from a service directly. If your servioce has admin rights however you can - in theory, I've not tried it - do it:
c# - Logoff interactive users in Windows from a service - Stack Overflow[
^]
But be careful. And either backup really well before you install the service for testign, or use a VM.
And don't bring your app anywhere near my PC! :laugh: