c# - Easier way to debug a Windows service -


is there easier way step through code start service through windows service control manager , attaching debugger thread? it's kind of cumbersome , i'm wondering if there more straightforward approach.

if want debug service, drop in debugger.break() in there. when line reached, drop me vs. don't forget remove line when done.

update: alternative #if debug pragmas, can use conditional("debug_service") attribute.

[conditional("debug_service")] private static void debugmode() {     debugger.break(); } 

on onstart, call method:

public override void onstart() {      debugmode();      /* ... rest */ } 

there, code enabled during debug builds. while @ it, might useful create separate build configuration service debugging.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -