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

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.


Subscribe To Newsletter For your Daily Development Tips and Tricks  

 Best Tips & Tricks on Microsoft Technology Platform 

Invalid email address
We promise not to spam you. You can unsubscribe at any time.
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 Comments to “How to use Runtime Objects in Watch Window during debugging in Visual Studio ?”

Comments are closed.