Debugging Custom Event Receivers – Strange Error on custom Event Receiver SharePoint 2010. .c__DisplayClass2.b__0()Object reference not set to an instance of an object.
Debugging Custom Event Receivers. Here's a weird error that took some time to figure out. Generic "Object reference not set to an instance of an object." Error on a custom SharePoint 2010 event receiver. If I went through the UI to change a field on a list, the event receiver fires fine. But, if a workflow changed the field it threw the error below. I finally found if I attached the OWSTimer process to Visual Studio, it would debug, but still not show the exact problem. The solution is to find the Log On account for OWSTimer in the Services console (services.msc) and then to grant that account permissions on the list that the event receiver is running on. Edit -checking the permissions of the OWSTimer account is just one possible solution. What I found out was that the list was hanging on to old event receivers as well. I [...]