Debugging Windows Services with "Edit & Continue"

I needed to debug Windows Services. But I didn't like  suggested in multiple articles Debugger.Launch.
 
I was able
2. Add in my service project a Reference to AndersonImes.ServiceProcess.dll
3. Change in the Main() function
//ServiceBase.Run(ServicesToRun);
ServicesLoader.StartServices(ServicesToRun,true);
Note that  AutoStart boolean second parameter is very convenient for immediate start of debugging, in particular if you have only one service.
 
And all VS debugging features, including F5 and Edit&Continue are available.
If you have some problems with this approach, see Five ways debugging .NET Windows service

posted @ Monday, December 08, 2008 9:35 PM

Print

Comments on this entry:

No comments posted yet.

Your comment:



 (will not be displayed)


 
 
 
 
 

Live Comment Preview:

 
«November»
SunMonTueWedThuFriSat
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345