how to keep running C# application after windows log off how to keep running C# application after windows log off windows windows

how to keep running C# application after windows log off


If you don't want your application to stop when the user logs out, then the application can't be running in the user's session (really a WinStation). That implies your app needs to run in a different session. The sessions that don't logout are service sessions. Run Task Manager and add the Session ID column, and view all processes, and you'll see what I mean.

So your application needs to run as, or be launched by, a service.


In addition to the first answer don't keep the service running under the specific user account. If you do so then also it won't work if you logged off.