C
Carlos Sosa Albert
Hi guys,
I'm trying to do just this, debug a Windows Service. I tried some ways I
found around the net but I wasn't able to get it to work.
This I found at http://www.codeproject.com/dotnet/DebugWinServices.asp and
seems like a nice approach, but when it talks about "<Your Service's Primary
Method Here>" I don't know what to do... =/
Any help, will gonna be VERY welcome.
//#if (!DEBUG)
// System.ServiceProcess.ServiceBase[] ServicesToRun;
// ServicesToRun = new ServiceBase[] { new Service1() };
// ServiceBase.Run(ServicesToRun);
//#else
// // Debug code: this allows the process to run as a
non-service.
// // It will kick off the service start point, but never
kill it.
// // Shut down the debugger to exit
// Service1 service = new Service1();
// service.<Your Service's Primary Method Here>();
// // Put a breakpoint on the following line to always catch
// // your service when it has finished its work
//
System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);
//#endif
Thanks,
Charly.
I'm trying to do just this, debug a Windows Service. I tried some ways I
found around the net but I wasn't able to get it to work.
This I found at http://www.codeproject.com/dotnet/DebugWinServices.asp and
seems like a nice approach, but when it talks about "<Your Service's Primary
Method Here>" I don't know what to do... =/
Any help, will gonna be VERY welcome.
//#if (!DEBUG)
// System.ServiceProcess.ServiceBase[] ServicesToRun;
// ServicesToRun = new ServiceBase[] { new Service1() };
// ServiceBase.Run(ServicesToRun);
//#else
// // Debug code: this allows the process to run as a
non-service.
// // It will kick off the service start point, but never
kill it.
// // Shut down the debugger to exit
// Service1 service = new Service1();
// service.<Your Service's Primary Method Here>();
// // Put a breakpoint on the following line to always catch
// // your service when it has finished its work
//
System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);
//#endif
Thanks,
Charly.