Operation is not valid due to the current state of the object


System.InvalidOperationException: Operation is not valid due to the current state of the object.    at Microsoft.SharePoint.SPUserToken.GetClaimsUserLoginName()
 
Setting a webapp to Claims Based authentication can screw up your web.config!! The line in bold beneath wasn’t there anymore :-s
Pulled my hear out, saw my collegas approaching with chainsaws… but my new collegue Nick saw suddenly the missing line in the web.config although it was described in our own manual Glimlach Eye of the tiger Glimlach
 
    <roleManager defaultProvider="c" enabled="true" cacheRolesInCookie="false">
      <providers>
 <add name="c" type="Microsoft.SharePoint.Administration.Claims.SPClaimsAuthRoleProvider, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
      </providers>
    </roleManager>
 
Advertisements
This entry was posted in Sharepoint and tagged , , . Bookmark the permalink.

4 Responses to Operation is not valid due to the current state of the object

  1. Courtney says:

    Hello,
    Which web config should this go in? I hae an environment that uses extended web applications.

  2. Mina says:

    Excellent, worked with me

  3. Ravi Agarwal says:

    Hi am also facing this issue in SharePoint 2013. Any help related to it. Exception
    Exception Source : Microsoft.SharePoint
    Stack Trace : at Microsoft.SharePoint.SPUserToken.GetClaimsUserLoginName()
    at Microsoft.SharePoint.SPSite.CopyUserToken(SPUserToken userToken)
    at Microsoft.SharePoint.SPSite.SPSiteConstructor(SPFarm farm, Guid applicationId, Guid contentDatabaseId, Guid siteId, Guid siteSubscriptionId, SPUrlZone zone, Uri requestUri, String serverRelativeUrl, Boolean hostHeaderIsSiteName, SPUserToken userToken, Boolean appWebRequest, String appHostHeaderRedirectDomain, String appSiteDomainPrefix, String subscriptionName, String appSiteDomainId, Uri primaryUri)
    at Microsoft.SharePoint.SPSite..ctor(SPFarm farm, Uri requestUri, Boolean contextSite, Boolean swapSchemeForPathBasedSites, SPUserToken userToken)
    at Microsoft.SharePoint.SPSite..ctor(SPFarm farm, Uri requestUri, Boolean contextSite, SPUserToken userToken)
    at Microsoft.SharePoint.SPSite..ctor(String requestUrl, SPUserToken userToken)
    at PriceRight.SP.SF.CONTROLTEMPLATES.PricerightSP.Proposal.SubmitComments.kickoffWorkflow1()
    at PriceRight.SP.SF.CONTROLTEMPLATES.PricerightSP.Proposal.SubmitComments.ButtonClickEventWorkflow(Object sender, EventArgs e)
    Exception Message: Operation is not valid due to the current state of the object.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s