Geeks With Blogs

News Hi, my name is Vincent Grondin and I'm a senior consultant at Fujitsu, a consulting firm in Montreal, Québec. I'm starting that blog to share some of my thoughts and knowledge on .NET architectures and code. Being a consultant in the .NET world I come across many different things. Some good, some bad and others that are worth a blog post here whether they be good, or hmmm... shall I say, less good :) I hope you enjoy yourself while learning new stuff. Feel free to leave a comment or contact me anytime.
Vincent Grondin


The "Quick Watch" feature of Visual Studio is an awesome tool when debugging your stuff...  I use it all the time and quite often I end up exploring hashtables or lists of all sorts...  One thing I hate is when I have to explore Collections...  Good god did I lose time trying to find the inner member that contains my stuff when exploring collections...  Most collections have the inside member that you can search for and find and explore to see the list of things you wanted to look at.  Something in the likes of this


I've known a little trick for a while now and I give it to everyone I end up debugging something with so I figured that probably not many people know about this...  Here's the tip...  Send the collection into an ArrayList in the QuickWatch window!  Yes, you heard me right, just type   

new ArrayList(yourcollectionhere)

in my case:    new ArrayList(this.Controls)

in the expresion textbox and here's the result when you hit reevaluate!

Pretty neat trick to make your debugging experience less of a pain when dealing with collections... 


Happy debugging all !

Posted on Sunday, May 2, 2010 8:53 PM | Back to top

Comments on this post: Tips on debugging collections

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Vincent Grondin | Powered by: