Run any WinForms program as a Windows Service with AlwaysUp

How to Run any WinForms GUI Application as a Windows Service with AlwaysUp

Automatically start your WinForms GUI in the background as a Windows Service, before anyone logs on. No need to modify your code!

Windows Forms (WinForms) is a widely-used GUI API included with the .NET Framework. Prior to the introduction of WPF in 2006, WinForms was the API of choice for .NET applications presenting a graphical user interface.

AlwaysUp includes advanced tools to make your WinForms executable start at boot and run 24/7.

The Application Advisor will help you install your WinForms executable as a Windows Service with all our recommended settings — in just a few clicks. Simply select Advisor from the Application menu and follow the straightforward prompts.

To run your WinForms application as a Windows Service with AlwaysUp:

  1. Download and install AlwaysUp, if necessary.

  2. Start AlwaysUp.

  3. Select Application > Add to open the Add Application window:

    Add Application

  4. On the General tab:

    • In the Application field, enter the full path to your WinForms application.

      For this tutorial, we will be running the CodeProject Social Club sample application, which uses WinForms, C#.NET, ADO.NET and MS Access. The full path to the application is:

      C:\WinForms\SocialClub\John.SocialClub.Desktop.exe
      and that will appear throughout. No doubt the path to your application will be different!

    • In the Name field, enter the name that you will call the WinForms application in AlwaysUp. We have entered My WinForms App but you can specify virtually anything you like.

    WinForms Windows Service: General Tab

  5. Click over to the Logon tab and enter the user name and password of an account that can run your WinForms application normally. Without this, your application may not find its settings (registry, permissions, etc.) and fail to run properly.

    And if you wish to completely hide your WinForms GUI from prying eyes, you should check the When a user logs on, don't show the application's windows and tray icons (if necessary) box. However we recommend leaving it unchecked at first - until you've gone through this process and validated that your application is working well. You can always activate this option later on.

    WinForms Windows Service: LogOn Tab

  6. If your Windows Forms program needs the network to do its work, click over to the Startup tab and check the Ensure that the Windows Networking components have started box.

    WinForms Windows Service: Startup Tab

  7. Click the Save button. In a couple of seconds, an application called My WinForms App will show up in the AlwaysUp window. It is not yet running though.

    WinForms Windows Service: Created

  8. To start the WinForms application, choose Application > Start "My WinForms App". The state should transition to Running after a few seconds:

    WinForms Windows Service: Running

    The application is currently running in Session 0. On Windows XP and Server 2003, we can see it by logging on to that session. On Windows 8/7/Vista and Server 2012/2008, we can see it if we go to the isolated Session 0 by selecting Tools > Switch to Session 0:

    WinForms Windows Service: Session 0

    Note that if you checked the box to hide the GUI in step 5, you won't see anything in Session 0 (or be pestered by the Interactive Services Detection Dialog).

  9. That's it! Next time your computer boots, your WinForms application will be launched immediately, before anyone logs on. Please reboot your PC now to test that everything works as expected.

    Afterwards, be sure to explore the other settings in AlwaysUp that may be helpful in your situation. Configure email alerts when the application fails, restart it nightly to clear out memory leaks, and much more!



WinForms program not working properly as a Windows Service?

  • From AlwaysUp, select Application > Report Activity > Today... to bring up a HTML report detailing the interaction between AlwaysUp and your application. The AlwaysUp Event Log Messages page explains the more obscure messages.
  • Review the AlwaysUp FAQ for answers to commonly asked questions and troubleshooting tips.
  • Contact us and we will be happy to help!

Download & Try it Free!

Download AlwaysUp and Run as a Service Today! Version 15.5 New!

8.0 MB Installer
Our 12,000+ customers include...
Compatible with Windows 11 Compatible with Windows Server 2022 Compatible with Windows 10
Over 94,000 installations, and counting!
 
AlwaysUp is number 1! Run as a Service with AlwaysUp

Rock-solid for the past 19+ years!