Is it possible to debug a windows service or class library without consuming the code in a launchable app? There is a thread about doing this, but the techniques don’t work and keep saying “Cannot start service…” as I am using a windows service.
Thanks
In you main function, rather than calling
ServiceBase.Run(servicesToRun), just run the actual code you want to test.I usually put in code to check for a command line parameter as in:
And then set up VS to send in -c while in debug mode.