While looking for information on multi-threaded debugging for Visual Studio 2005, I found this article by Peter Bromberg that has some decent Visual Studio 2005 debugger tips. Its definitely worth reading over if you use Visual Studio 2005. I know I learned a thing or two.
One tip I would add to this article is to use the immediate window when debugging. It seems like all VB'ers know about this one, but relatively few C# developers do.
The immediate window allows you to evaluate code while debugging. Lets say I wanted to print out the value of a property in the immediate window, I could do any these expressions:
I find this is often faster than trying to dig through a watch window, especially on a large class.
You can even call code directly from the immediate window, which I think is where it's real power lies. With this you can create a generic debug method in your code that prints out all the values of a collection, which can then be called from the immediate window passing in any collection.
internal static void PrintAll(IEnumerable coll)
{
foreach (object item in coll)
Debug.Print(item.ToString());
}
Powered by: newtelligence dasBlog 2.1.8102.813
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2010, Shawn Neal
E-mail