04
Aug 13

Blackbox diagnostics

Earlier this year, I made the switch from development to consulting. This brought on a whole new set of challenges; one of which is diagnostics. As a developer, if there is an issue, you set a few breakpoints, reproduce the issue, step through the source code, and figure out what the problem is. As a consultant, you typically don’t have the luxury of source code. Debuggers can be hard to come by. You just have to make do with what you’ve got. Luckily, there are a few trustworthy tools that can typically be loaded onto an environment to help with the troubleshooting.

Process Explorer

Ever wondered which program has a particular file or directory open? Now you can find out. Process Explorer shows you information about which handles and DLLs processes have opened or loaded. Process Explorer is useful for tracking down DLL-version problems or handle leaks, and provide insight into the way Windows and applications work.

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

Process Monitor

Process Monitor is an advanced monitoring tool for Windows that shows real-time file system, registry, process and thread activity. It combines the features of two legacy Sysinternals utilities, Filemon and Regmon, and adds an extensive list of enhancements including rich and non-destructive filtering, comprehensive event properties such session IDs and user names, reliable process information, full thread stacks with integrated symbol support for each operation, simultaneous logging to a file, and much more.

It is useful for narrowing down the point of failure. Missing files and registry keys, as well as permission issues can be easily identified with this tool.

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

DebugView

DebugView is an application that lets you monitor debug output on your local system, or any computer on the network that you can reach via TCP/IP. It is capable of displaying both kernel-mode and Win32 debug output, so you don’t need a debugger to catch the debug output your applications or device drivers generate, nor do you need to modify your applications or drivers to use non-standard debug output APIs.

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

SQL Profiler

If you suspect issues at the database level, such as blocking and deadlocks, the SQL Profiler is the best bet. The SQL Profiler is part of the SQL Server Management Studio.

Wireshark

Wireshark is a network protocol analyzer. It is useful for capturing and analysing network traffic.

http://www.wireshark.org/

.NET Framework Tools

The .NET Framework tools are part of the .NET SDK and are invaluable for analyzing .NET related issues.

  • Fusion Log Viewer (fuslogvw) is great for identifying .NET binding issues, such as missing DLLs.
  • Corflags Conversion Tool (corflags) can be used to force an application to run in 32-bit mode.

Download .NET Framework 4.0 Tools

Debug Diagnostic Tool

The Debug Diagnostic Tool (DebugDiag) can capture and analyse process dumps for application crashes, application hangs, and memory leaks. It can also be configured to log stack traces on first and second chance exceptions; really useful for situations where the application swallows the exceptions.

http://www.microsoft.com/en-us/download/details.aspx?id=26798

Beyond Compare

This is not free, but it is a really good file and folder comparison tool. It is great for when you have a reference point (eg: a known good implementation). It can be used to identify missing or outdated files, as well as incorrect configurations.

http://www.scootersoftware.com/

.NET Reflector

Most .NET assemblies can be decompiled to produce the source code. While not the original, the decompiled source code is easily readable. This ability does come at a price. The later versions of the tool even enable users to step through the code; though I’ve never tried it myself.

http://www.red-gate.com/products/dotnet-development/reflector/