That wasn’t too descriptive was it? Not sure if this has been documented anywhere else but I came across a quirk today while I was trying to create custom Event Handlers for a Document Library.

Environment:
Windows 2003
MOSS 2007
Visual Studio 2008
Visual Studio SharePoint Extension Kit 1.2

Scenario:
Using the EventReceiver SharePoint template in Visual Studio, I started out with the ItemUpdating method and deployed some code a few times and then decided to switch to using the ItemUpdated method instead. For a dozen builds or so after that I couldn’t figure out whether or not my code was working or the ItemUpdated event was even firing. When I switched back to the ItemUpdating method, it worked as expected even with new code. Switched back to ItemUpdated and no good, no events fired even after IIS resets.

Solution:
Finally I decided to remove the event handler manually by doing the following:

– deactivated the feature
– retracted the solution
– deleted the solution
– deleted the dll in the GAC
-IISReset

Then after rebuilding/redploying the solution everything worked just as expected. Woohoo!

Advertisement