Earlier this week I was doing a presentation and since the company I presented for had mostly winforms developers I wanted to convert all my ASP.NET debugging demos to winforms equivalents for the presentation.
As I was converting my first demo (a performance issue) I ran into a bit of a snag because the first time I ran the demo (which populates 4 datagridviews with product information) things worked fine. I clicked the Featured Products button, my datagrids were nicely filled, I could reproduce my performance issue and debug it.
The second time I clicked the button to reproduce the issue however I was met with this:
Instead of data in my datagrids they were just covered with big red X:es and the application crashed with a NullReferenceException (Object reference not set to an instance of an object) in System.Windows.Forms.DataGridViewRowHeaderCell.PaintPrivate.
I have attached the faulting application to this post if you want to try reproducing and debugging the issue and figure out what happened… feel free to post your suggestions for causes and resolutions in the comments…
The first comment that leads to a resolution will be dubbed “Master Debugger August 2008”:) I’ll post my answer later on …