Tuesday, July 17, 2012

In order to evaluate an indexed property, the property must be qualified and the arguments must be explicitly supplied by the user.

Most .NET programmers have probably seen this message when debugging their code. This most often occurs on the Item property of the various Collection types. It basically means that the debugger visualizer doesn't know how to display the value for this property and is requesting that the user provide an index to the property.

Short of writing a custom visualizer for Collection types, the easiest solution I can find is to go to Tools -> Options -> Debugger -> General and check Show all members for non-user objects in variables windows (Visual Basic). This tells the visualizer to display the private members of classes. I found that this allows me to drill down and find the information I need.

For example, I normally see this when trying to visualize a ListItemCollection.




There is no way for me to drill down further and see the contents of the Item property.

Once show all members are turned on, I am now able to see the listItems member and drill down to see the contents of the collection.





Until Microsoft upgrades Visual Studio to be smart enough to recognize these collection types and display the information we need, this is the best option that I've found so far.


Thursday, July 5, 2012

Checking IIS 7 Event Logs

One of the simplest ways to troubleshoot IIS issues is to check the event logs. This can be done by running the Event Viewer. Click the Windows Start button, type "eventvwr" and press enter. Or if this is too hard to remember, simply type event and the Event Viewer should show under Programs in the search results.

The Event Viewer can easily be found by typing 'event' in the search box after clicking the Windows Start button



Go to Windows Logs -> System and on the right panel look for events from WAS.

Event Viewer System Log


You can also create a custom view to only find the WAS events. Right click on Custom Views -> Create Custom View -> Click the "By source" radio, select WAS as "Event Source" and click OK.