I read a bunch of threads on social.msdn regarding issues with Event Recievers on custom lists that fires twice, but I’m not sure this is the current problem I have. I have been using SP Manager and Event Handler Explorer to see if I could find any duplicate event handler registrations, but it’s empty. I’m almost out of any more hair on my head to pull out.

The site/list where the problem occur comes from a SP-Export/SP-Import, some functionality like workflows, webparts and the Event Recievers is deployed thru a feature. The thing is, if I disable the feature which contains the Event Recievers, it is only fired once. ‘

If I enable the feature again, it is fired twice. So it seems that this Event Recievers is stocked on the custom list, even though the feature is disabled. I have been trying to do some housecleaning on the feature_deactivating method, where I delete any Event Recievers on the custom list, but it doesn’t seem to do anything.

If I browse through the Event Handler Explorer, the only two EventHandlers I can find on the list is

Microsoft.SharePoint.Workflow.SPWorkflowAutostartEventReceiver, ItemAdded Microsoft.SharePoint.Workflow.SPWorkflowAutostartEventReceiver, ItemUpdated

And not the one I have been created.

What is going on?

Best regards Duftstenen

  • Was your custom list saved as a template and then reinstantiated? – Andy Burns Feb 1 '12 at 9:57
  • Hi Andy, it was exported from the dev site with Export-SPWeb to the production site with an Import-SPWeb – Duftstenen Feb 1 '12 at 10:01
  • Well, when exported it might have been exported with the event handler registrations in place - which might explain how you get them running twice - but I don't know why you can't see them. – Andy Burns Feb 1 '12 at 16:53
  • Alright, how can i use Export-SPWeb to export a site, where I don't get those "feature based" stuff included. Im not very thrilled to use the Web based export functionality. – Duftstenen Feb 3 '12 at 11:08
  • @Duftstenen Have you tried deactivating the features before exporting the site and then import it on another, to see if the problem still occurs? – user2536 Feb 18 '12 at 22:19

Okay, I ended up with doing one thing, adding the items to a custom contenttype, instead of using the generic "Element". The EventReceiever was then added to only react on that contenttype, having the "Feature activating" to add eventreciever to that specific contenttype. Then I got the right picture in the SP Manager 2010. Somehow that was not visible in SP Manager 2010, when doing that for "Element".

Thanks for any help in this matter!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.