Version 1.1 of the .NET Framework introduces a handy feature called Customer Debug Probes (CDP). These probes enable you to find and diagnose difficult bugs lurking in managed code, even in a production environment.
I'll share the details of each probe in future blog entries, so stay tuned. In the meantime, I've uploaded a tool (with source code) to gotdotnet.com called CLR SPY that makes it easy to use the probes. Here's a screenshot:
CLR SPY runs in the taskbar notification area. It can display balloon tooltips and/or log messages to a file. Here's an example of it in action:
To get a feel for the tool, add any managed application to the "Monitored Applications" list and run it with the Marshaling probe enabled. You should see a flurry of messages appear as parameters get marshaled to unmanaged code.
This dynamic analysis tool is a great complement to FxCop's static analysis for writing high-quality managed code. Use it to find your bugs before your customers do! Let me know what you think of the tool!
Note: When using debug probes, you could run into bugs (or unwanted noise) in components you depend on - even in the .NET Framework! For example:
If you run into other violations reported by the probes that you don't think are your fault, let me know.