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.
Pingback: SHRAVAN Weblog » 14 Useful .NET Debugging Tips & Tricks in Visual Studio
Pingback: 10 Effective Debugging Tips for .NET Developer