0

My project had a feature, and on activation of this feature, I was binding an event receiver to a list; on deactivation, the event receiver was removed.

It so happened that this feature was activated on my site. Now I manually retracted and removed my solution from the site, but I forgot to deactivate this particular feature.

Now I checked the features folder, and this feature was not present; it must have got removed when the solution was retracted.

I would like to know what would have happened to that event receiver, which was attached to my list.

2

as far as I know retracting solutions doesn't deactivate their features, so although you wont be able to find or activate/deactivate those features, their references are still there.

on the particular case of event receivers, it could turn out to be a major problem. the receiver may still be attached and if you redeploy/reactivate you may end up with firing twice.

similar post here

http://social.technet.microsoft.com/Forums/en-US/a911a64f-b4cb-49a8-ad61-899d4e418c2a/sharepoint-2010-event-receiver-still-working-even-if-i-have-removed-feature?forum=sharepointgeneralprevious

sp event receiver manager

http://speventreceiverman.codeplex.com

0

In that case, event receiver still attached to the list and cause alot of problem to your site.Only thing you can do is simply delete it.

run this script to get the event receiver attach to a list.

$spWeb = Get-SPWeb -Identity http://web.spdev.local
$spList = $spWeb.Lists["My List Name"]
$spList.EventReceivers | Select Name,Assembly,Type

Now you want to delete it.

$spWeb = Get-SPWeb -Identity http://web.spdev.local
$spList = $spWeb.Lists["My List Name"]
$eventsCount = $spList.EventReceivers.Count
$assembly = "Project.Name.Class, Version=1.0.0.0, Culture=neutral, PublicKeyToken=24242342424"
$class = "Namespace.MyClass.ClassName"
$type = 10002
$name = "My Event Name"
for ($i = 0; $i -lt $eventsCount; $i+=1) 
{ 
   if ($spList.EventReceivers[$i].Assembly -eq $assembly -and
       $spList.EventReceivers[$i].Class -eq $class -and
       $spList.EventReceivers[$i].Type -eq $type -and
       $spList.EventReceivers[$i].Name -eq $Name) 
   { 
      $spList.EventReceivers[$i].Delete() 
   } 
}
$spList.Update()

http://blogs.solidq.com/sharepoint/Post.aspx?ID=80

Also check this post as well

http://naimmurati.wordpress.com/2012/03/22/add-modify-or-delete-list-event-receivers-with-powershell/

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.