locked
Feature activation error: System.InvalidOperationException: Operation is not valid due to the current state of the object. RRS feed

  • Question

  • Hi all!

    I have the problem with my custom feature activation. This feature contains list definition and event receivers for this list. Some of this event receivers have references on wcf services. In the web.config of the web application i wrote bindings for this services.

    But when I try to activate feature, i get the following error:

     

    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.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, Boolean fForce)     at Microsoft.SharePoint.SPFeatureCollection.AddInternal(SPFeatureDefinition featdef, Version version, SPFeaturePropertyCollection properties, Boolean force, Boolean fMarkOnly)     at Microsoft.SharePoint.SPFeatureCollection.AddInternalWithName(Guid featureId, String featureName, Version version, SPFeaturePropertyCollection properties, Boolean force, Boolean fMarkOnly, SPFeatureDefinitionScope featdefScope)     at Microsoft.SharePoint.SPFeatureCollection.Add(Guid featureId, Boolean force, SPFeatureDefinitionScope featdefScope)     at Microsoft.SharePoint.WebControls.FeatureActivator.ActivateFeature(Guid featid, SPFeatureDefinitionScope featdefScope)     at Microsoft.SharePoint.WebControls.FeatureActivatorItem.BtnActivateFeature_Click(Object objSender, EventArgs evtargs)     at System.Web.UI.WebControls.Button.OnClick(EventArgs e)     at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)     at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

     

    And in the EventLog i see Event manager error: Exception has been thrown by the target of an invocation.

    Event Id 6644

     

    This error appears on our customer's environment, but i can't reproduce it on mine. I get the same error, when make mistake in binding name, but in this case web.config on customer's web application is correct.

     

    Any ideas, what can be the cause of this problem?

     

     

    P.S. Sorry for my english :)

    Monday, May 16, 2011 7:11 AM

Answers