0
votes

I am implementing an event handler in a WSS 3.0 environment. I've created a VS project with a new class that inherits from SPEventItemReceiver. I built my project and manually deployed this assembly to the GAC via copy/paste. I use a simple console program to add the event handlers to my SharePoint list. The first iteration of my event handler code worked as expected.

For my next step, I updated the code in my event handler to change the functionality. I've tried removing the assembly from the GAC and re-adding it. That didn't help. I've unregistered and re-registered my event handlers for the list and that did no good either. Even though the code is different and I've re-deployed the assembly - I'm still getting the old (original) functionality.

An example of this change: Originally I was assigning a text field with a hard coded value. In the updated code that assignment still exists but I've changed the hard coded value I'm assigning. Now, when the event handler fires - it's still assigning the original value.

Can anyone help me understand why my updated code isn't working and how I would go about deploying my updated event handler code?

Thanks!!!

2

2 Answers

4
votes

You just need IISRESET after updating the assembly in GAC.

0
votes

Madhur's suggestion works for testing changes. You may need to restart more services (i.e. Timer Service) for all processes to use new assembly. Also IISReset is not the best way to get updated assemblies loaded to ASP.Net process, but good enough for development machine.

For more robust deployment you should use features infrasrtucture built into SharePoint. I.e. this article http://developers.de/blogs/adis_jugo/archive/2009/03/12/develop-and-deploy-a-sharepoint-event-receiver-from-the-scratch.aspx covers all steps you need to correctly deploy a receiver.