Click here to Skip to main content
15,613,470 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,
I need to start a .Net Win Forms application and keep it running independently of having or not a user logged in. It is a desktop application with GUI.
This application captures data that come from sensors, serial ports, connects with other remote instances using MQTT, and controls some other external I/O devices using serial ports and sockets. The client needs to inspect the application's GUI periodically and check for event and alarm reports.
To my knowledge, the best way for doing something like this would be to write one service and one application and make then communicate using one IPC method, but I need to have something working for next week, which makes me run out of time for adapting everything to service+application.

Thanks a lot in advance.

What I have tried:

I've found AlwaysUp[^], will test it now, but I wonder if there is another type of solution for this. Any ideas?
Updated 4-Dec-20 22:02pm

1 solution

You can't.
That's the whole point. The only way to run an app before the user logs in is to make it a service - and they cannot have any UI at all, no interaction with the display, keyboard, or mouse.

A service and an application that runs when the user is logged in to communicate with the service is your only route.
Share this answer
V.Lorz 5-Dec-20 6:20am    
Thanks for the comment.
I understand, that's the point, to my best understanding for certain time now services can't have any UI and must use other means for communicating with users.
But thing is these guys at coretechnologies have AlwaysUp, as I introduced in my question. They claim AlwaysUp can run the application in the isolated session 0, yet the UI will not be visible, of course.
Using something similar, if the user needs to change any application settings, he/she can stop the service, start the application in normal user space (current session), change whatever is needed, then restart the service again.
Using that workaround I could manage to have the user starting one instance that could be configured for using the MQTT data channels I already have in the application for sharing sensors data and see the overall state.
That's my idea, you think it would work? Any alternative to AlwaysUp you could know of?
Thanks a lot again

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900