When you use SharePoint 2010 event receivers for sites, webs or list you may get a broken event receiver definitions. It could be due to incorrect event receivers managment, you used packages that left broken event receiver definitions or something like that.
It is too hard to manually remove all broken definitions from whole site collection. I do not know useful tool for this purpose.
The following script do it for you. It is iterates through all webs and lists into site collection and remove all event receiver definitions that point to not exist assemblies.
open Microsoft.SharePoint module EventReceiversCleaner = let private isAssemblyExist (assemblyName:string) = try match System.Reflection.Assembly.Load(assemblyName) with | null -> false | assembly -> assemblyName = assembly.FullName with | e -> false let private removeCandidates = ref List.Empty let CollectBroken (collection:SPEventReceiverDefinitionCollection) = for er in collection do if not (isAssemblyExist er.Assembly) then removeCandidates := er :: !removeCandidates let RemoveAll() = !removeCandidates |> List.iter (fun (er:SPEventReceiverDefinition) -> let name = sprintf "Assembly:'%s'" er.Assembly try er.Delete() printfn "Deleted : %s" name with | e -> printf "Failed to delete: %s" e.Message) try let url = "http://localhost/" printfn "Connecting to '%s'..." url use site = new SPSite(url) site.EventReceivers |> EventReceiversCleaner.CollectBroken let rec collectFromLists (web:SPWeb) = printfn "Processing web '%s'..." web.ServerRelativeUrl web.EventReceivers |> EventReceiversCleaner.CollectBroken web.Webs |> Seq.iter collectFromLists for list in web.Lists do printfn "Processing list '%s'..." list.Title list.EventReceivers |> EventReceiversCleaner.CollectBroken use web = site.OpenWeb() collectFromLists web EventReceiversCleaner.RemoveAll() printfn "Finished." with | e -> printfn "Exception : %s" e.Message System.Console.ReadLine() |> ignore
P.S. You should compile it using .NET 3.5 and 64 bit project.