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.
4 comments
-
radioman.lt
commented
just add #if DEBUG .. #endif and launch program as usual program, not service
-
mark kang
commented
awesome idea
-
tf
commented
It would be nice if the Run Command in VS would:
- Compile the service
- Install the service
- Start the service
- Attach to the serviceAnd the stop command:
- Detach from the service
- stop the service
- uninstall the serviceThis way we can debug services in the same way as any other program.
-
Anonymous
commented
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.