Show All Instances
Find specific objects in memory that you want to explore
OzCode makes it trivial to find specific objects in memory that you want to explore. Just open Show All Instances of Type, and you’ll be able to see every object of that type that’s currently in memory. Why is that object still in memory? Are there any objects that contain this value? OzCode effortlessly and instantly answers these questions and more.
Using Show All Instances
Immediatly a message box pops up since an exception was thrown:
Not very informative and we need to investigate this problem further.
To understand the problem we need to break when the exception is thrown, and so we can either use Visual Studio's built in exception settings dialog, or simply click the "Break on all CLR excetions" button:
Re-run the sample - you should break on SendInvoice call:
A quick check should show the problem with this method call --> customerEmail is null which should not happen.
Unfortunalty InvoiceService implementation makes it hard for us to find which Customer caused the problem. And although we can quickly fix this issue by adding a check, we still need to find the offending customer! Since we only have the invoiceID we can look for it using OzCode's Search.
Use the watch to view pendingInvoiceId and choose 'Copy Value':
Then, put your caret on the word 'Customer' (the class name) above and open the QuickActions menu:
Choose 'Show all instaces of Customer' to make the dialog appear. Paste the invoice value in the seatch box (buttom) to search for the invoiceID you just copied:
Using the little 'eye' we can expand the selected customer to see all of the instance properties, and look for the emailAddress
Finally we can see that that customer was loaded without an emailAdress which means that we might have a data corruption problem on our hands.