SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i have taken one List Email event receiver(Type is EmailReceived) and that event receiver attach with document library. when i am activate that feature got error. i have check on ULS Viewer. error look like :

Feature Activation: Threw an exception, attempting to roll back. Feature 'Email_Doclib_Email Receivers' (ID: '8bb3a20f-22b6-4d05-b451-5db1a2714063').
Exception: System.InvalidOperationException: Operation is not valid due to the current state of the object. at Microsoft.SharePoint.Administration.SPElementDefinitionCollection.ProvisionContentTypeAndEventReceiverBindings(SPFeaturePropertyCollection props, SPSite site, SPWeb web, Boolean fForce)
at Microsoft.SharePoint.Administration.SPElementDefinitionCollection.ProvisionElements(SPFeaturePropertyCollection props, SPWebApplication webapp, SPSite site, SPWeb web, Boolean fForce)
at Microsoft.SharePoint.SPFeature.ProvisionElements(SPElementDefinitionCollection elemdefcoll, SPFeaturePropertyCollection props, SPWebApplication webapp, SPSite site, SPWeb web, Boolean fForce)
at Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, Boolean fForce)

right now there is no code on this Event receiver.

here is my Element file of Receiver

 <Receivers ListTemplateId="101">

share|improve this question
Yes, in my case, it was renaming the namespace which caused the issue. I had updated only the class.cs and not the elements.xml. Did so and it worked like a charm! Thank you very much ali Sharepoint! – user18038 Jul 3 '13 at 15:32
up vote 1 down vote accepted

try this:

goto task manager and find


Now remove it (end process), also perform an iisreset to remove any w3wp.exe and try again, it should work then!

if it doesnt than its an issue with your elements.xml file. make sure all your tags are correct including your class tag(<Class> </Class>) that should be your namespace followed by the class name and also the assembley name should be correct otherwise it will not work ;).

hope it helps :)

share|improve this answer
Hi,i got hints from your second options.i am checking on my dll on assembly but dll not exist on assembly.i just drag and drop Dll to assembly now activated featured successfully. do you know when cause like this prob? – Jigs Jan 7 '13 at 11:09
You need to check your manifest file, if its done through wspbuilder it will do it for you, if you made it then you need to state that you want to add it to the assembly, check DeploymentTarget is set to GlobalAssemblyCache :) – ali Sharepoint Jan 7 '13 at 11:24
but.i want to deployed wsp to specific web-application. so i have set Assembly Deployment Target = Web Application instead of GlobalAssemblyCache.may be create prb by this? – Jigs Jan 7 '13 at 11:26
Yes it is a problem as its copied to the virtual bin directory instead of the assembly ;) check this link out it will explain the two :) – ali Sharepoint Jan 7 '13 at 11:30
plesase check this out see if your doing your assembly the same for the webapp. (scroll down to see code) – ali Sharepoint Jan 7 '13 at 11:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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