How to use Runtime Objects in Watch Window during debugging in Visual Studio ?

By | January 20, 2011

During debugging in visual studio we generally used watch window to explore the objects, values, properties and other nested objects as a tree structure. Most of the time we used watch window to only view the values or change the current object properties values to see the effects of changed object during debugging. And most of the time we debug with the context of current object, object values etc but what if, If you need a brand new object instead of object value. This scenarios will come when you want to compare some existing value with some new object values. You can instantiate a new object by just type new ClassName(), which will generate you the new instance of your class as shown in below picture.


But, you need to take help of Immediate window if you want to declare a new object to used it further


As shown in above image you can create new object and used it immediate window.

Why do we need to take help of Immediate window to declare the object ? because Immediate window does not allow you declaration statements.


Author: Abhijit Jana

Abhijit runs the Daily .NET Tips. He started this site with a vision to have a single knowledge base of .NET tips and tricks and share post that can quickly help any developers . He is a Former Microsoft ASP.NET MVP, CodeProject MVP, Mentor, Speaker, Author, Technology Evangelist and presently working as a .NET Consultant. He blogs at , you can follow him @AbhijitJana . He is the author of book Kinect for Windows SDK Programming Guide.

2 thoughts on “How to use Runtime Objects in Watch Window during debugging in Visual Studio ?

  1. Pingback: SHRAVAN Weblog » 14 Useful .NET Debugging Tips & Tricks in Visual Studio

  2. Pingback: 10 Effective Debugging Tips for .NET Developer

Comments are closed.