Debugging Applications for MicrosoftВ® .NET and Microsoft WindowsВ® (Pro-Developer)
|
Although managed code is terrific because we no longer have to mess with memory corruptions and leaks, we still have to know how to use the debugging features. In this chapter, I concentrated on the unique issues associated with Visual Studio .NET and debugging managed applications.
I started by discussing the issues particular to advanced breakpoints. It's absolutely wonderful that Visual Studio .NET can call methods and properties from conditional breakpoints, but it means you must be extra careful to avoid causing side effects in your breakpoints. Also remember that if you mess up the condition, the debugger won't stop if it can't properly evaluate the condition.
The exciting Watch window offers all sorts of extra power for managed applications. With its full expression evaluator, you can easily call methods and properties so that you can influence debugging behavior to help your testing efforts. Additionally, for C# and Managed Extensions for C++ applications, you can add your custom types to the autoexpand rules to make debugging even faster.
Finally, although you might never program in MSIL, it's simple to learn and can help you truly see what the .NET Framework class library is doing behind the scenes. If you'd like more information about MSIL, make sure to check out Partition III CIL.DOC, which you can find in <Visual Studio .NET installation directory>\SDK\v1.1\Tools Developers Guide\docs. In that information, you'll find the lowdown on every instruction and what each does.
|