How to keep working with a C # application after logging out

I wrote a C # application using RESTful web services. This application should periodically interact with our server application. I want this program to continue to run in the background, even if the user logs out of the computer. How can I do this in C #?

+6
source share
2 answers

If you do not want your application to stop when a user logs off, the application cannot be launched in a user session (indeed WinStation ). This means that your application must be running in a different session. Sessions that do not log out are maintenance sessions. Launch the task manager and add a session id column and look through all the processes and you will see what I mean.

Thus, your application should start as or be launched by the service.

+1
source

In addition to the first answer, do not force the service to run under a specific user account. If you do this, it will also not work if you log out.

0
source

All Articles