So you want to build a MS Windows service application? Xojo is my choice for a RAD IDE.
The obvious place to start is MS Visual Studio, you choose your favorite development language & code away, but when it comes to debugging your project you find the pain. 99% of the project can be tested when running as a console application, but you need to change the project type to console to test. Then of course there’s that last 1%, the service app start, stop, pause & resume along with the security partitioning & file locations.
With MS Visual Studio the steps required to debug your service project (taken from https://docs.microsoft.com/en-us/dotnet/framework/windows-services/how-to-debug-windows-service-applications ) are:
1. Build your service in the Debug configuration.
2. Install your service. For more information, see How to: Install and Uninstall Services.
3. Start your service, either from Services Control Manager, Server Explorer, or from code. For more information, see How to: Start Services.
4. Start Visual Studio with administrative credentials so you can attach to system processes.
5. (Optional) On the Visual Studio menu bar, choose Tools, Options. In the Options dialog box, choose Debugging, Symbols, select the Microsoft Symbol Servers check box, and then choose the OK button.
6. On the menu bar, choose Attach to Process from the Debug or Tools menu. (Keyboard: Ctrl+Alt+P)
The Processes dialog box appears.
7. Select the Show processes from all users check box.
8. In the Available Processes section, choose the process for your service, and then choose Attach.
9. Choose the appropriate options, and then choose OK to close the dialog box.
10. Set any breakpoints you want to use in your code.
11. Access the Services Control Manager and manipulate your service, sending stop, pause, and continue commands to hit your breakpoints.
Now it has always seemed daft to me that you would load VS, build your project in the debug configuration, install the service and start it — then exit VS & reload it with admin credentials — surely you would just start with step 4? This wouldn’t really alter the number of steps required to debug, just make it more efficient
Anyhow with Xojo I follow these steps:
1. Start Xojo with administrative credentials so you can attach to system processes.
2. Build your Debug service by selecting Project->Run Paused.
3. Install your service. For more information, see How to: Install and Uninstall Services.
4. Start your service, either from Services Control Manager, Server Explorer, or from code. For more information, see How to: Start Services. The Debug article will connect back to the IDE for debugging.
5. Access the Services Control Manager and manipulate your service, sending stop, pause, and continue commands to hit your breakpoints.
You may have noticed there are a few less steps to the process (like 50% — there was one optional step in the VS procedure). Also consider that Xojo Service Apps will run in console mode without modification.