c# - Debugging Stopping a Windows Service -


i'm debugging windows service in vs2010 with:

static void main() {     #if (debug)         var s1 = new service1();         s1.start();         thread.sleep(timeout.infinite);     #else         servicebase.run(new servicebase[]              {                  new service1()              });     #endif } 

this lets me run service in debugger. problem on starting, service opens wcf channel seems tie socket after kill process stopping debugging. how close socket when stop debugging or if service stopped. tried setting breakpoints in service destructor, , both onstop , onshutdown methods, these aren't called.

as far know when end debugging in visual studio, process killed without calls finalizers , code located finally blocks not executed.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -