Tools

Process Monitor / ProcMon

http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx

 

DebugDiag

http://blogs.msdn.com/b/debugdiag/archive/2013/10/03/debugdiag-2-0-is-now-rtw.aspx
http://www.microsoft.com/en-us/download/details.aspx?id=40336

 

 

General debugging notes

http://allen-conway-dotnet.blogspot.com/2011/07/debugging-code-techniques-in-vsnet-2010.html
http://sharpertutorials.com/using-the-debugger/
http://www.codeproject.com/Articles/111965/Tips-on-Debugging-Using-DebuggerStepThrough-attrib

 

 

http://msdn.microsoft.com/en-us/library/system.diagnostics.debuggerstepthroughattribute.aspx

 

VS 2010 Flag a Method to not be stepped into on debugging

use DebuggerStepThrough or DebuggerUsercode

 

 

Debugging a windows service

Easier debugging a windows service

 

Conditional("DEBUG_SERVICE") attribute.

[Conditional("DEBUG_SERVICE")]
private static void DebugMode()
{
    Debugger.Break();
}

 

On your OnStart, just call this method:

 

public override void OnStart()
{
     DebugMode();
     /* ... do the rest */
}

 

There, the code will only be enabled during Debug builds. While your at it, it might be useful to create a separate Build Configuration for service debugging.

 

See Also

Logging
Profiler
Log4Net
AspDotNet.Debugging

 

Category Tags

Logging Debugging Troubleshooting