Answered by:

How To Run Service in Debug Mode

Question

Perhaps this is a silly question, but I never could figure it out. How do I set breakpoints and debug a service? I can't start the service with the "debug" button because it tells me there is no entry point. I assume there is a way to do this, and it'd be very helpful.

Answers

In Visual Studio select the project properties. Go to the 'Debug' page and specify the

external program to run (dsshost.exe) and its command line args (/h:50000 /t:50001 /c:<contract of your service>) You should then be able to F5 (run from VS) your service any breakpoints that you set should be hit.

dssnewservcice will create those project settings for you.

Alternatively you can attach the VS debugger to a running dsshost process (Debug -> Attach to process...)

All replies

In Visual Studio select the project properties. Go to the 'Debug' page and specify the

external program to run (dsshost.exe) and its command line args (/h:50000 /t:50001 /c:<contract of your service>) You should then be able to F5 (run from VS) your service any breakpoints that you set should be hit.

dssnewservcice will create those project settings for you.

Alternatively you can attach the VS debugger to a running dsshost process (Debug -> Attach to process...)