Allow me to run windows service projects (and stop/start) from Visual Studio
I work with windows services all day. I compile but compilation fails because my windows service is running. I jump to Services.msc and then stop the service. Then I compile again, then wait for it to finish, then jump back to services.msc and start the service. If i try to Run the project through VS, it says you can't do it. I'd like to manage this lifecycle all within visual studio. Allow me to know if a service is running or not and allow me to stop and start it. Also, allow me to Run and windows service project.
just add #if DEBUG .. #endif and launch program as usual program, not service
mark kang commented
It would be nice if the Run Command in VS would:
- Compile the service
- Install the service
- Start the service
- Attach to the service
And the stop command:
- Detach from the service
- stop the service
- uninstall the service
This way we can debug services in the same way as any other program.
I agree, but as a workaround, you can probably put in a pre-compile step to uninstall the service, and a post-compile step to reinstall the service.