none
Unable to cast object of type 'System.Security.Principal.WindowsIdentity' to type 'Microsoft.IdentityModel.Claims.ClaimsIdentity'

    質問

  • I saw posts about this error and tried solutions described there (KB 975603 and adding membership provider), but  it didn't work.

    It is clean installation of Commers Server 2009 on Windows 2008 SP, SQl Server 2008 R2, SharePoint 2010. Everything is by default. SharePoint site collection is created, but it blows up on every page with this:

    Unable to cast object of type 'System.Security.Principal.WindowsIdentity' to type 'Microsoft.IdentityModel.Claims.ClaimsIdentity'

    InvalidCastException: Unable to cast object of type 'System.Security.Principal.WindowsIdentity' to type 'Microsoft.IdentityModel.Claims.ClaimsIdentity'.]
       Microsoft.Commerce.Portal.Common.SiteContext.RetrieveValueFromClaims(String claimType, String issuer) +79
       Microsoft.Commerce.Portal.Common.SiteContext.get_IsUserProfileAuthenticated() +92
       Microsoft.Commerce.Portal.UI.Profiles.UserControls.ShopperName.Page_PreRender(Object sender, EventArgs e) +72
       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
       System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
       System.Web.UI.Control.OnPreRender(EventArgs e) +11028046
       System.Web.UI.Control.PreRenderRecursiveInternal() +108
       System.Web.UI.Control.PreRenderRecursiveInternal() +224
       System.Web.UI.Control.PreRenderRecursiveInternal() +224
       System.Web.UI.Control.PreRenderRecursiveInternal() +224
       System.Web.UI.Control.PreRenderRecursiveInternal() +224
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3394

    -Stan

     

     

     

    2011年7月20日 20:33

回答

  • Problem is solved, posting back in case anybody else needs it.

    Part of installation was to create a web application, There was a section about it in the installation guide and thought it was usual yadayada, but it turned out that the web app should be created with claim-based authentication and custom provider. This can be done manual or with wizard. I chose wizard and the problem went away. So if you have default web app, it won't work...

    -Stan

    • 回答としてマーク Stan B 2011年7月21日 12:37
    2011年7月21日 12:37

すべての返信

  • Commerce Server 2009 does not support SharePoint 2010 out of the box, you need the template pack for this. Or did you perhaps mean Commerce Server 2009 R2?
    Hope this helps.

    Regards

    Glen (Software) Smith MCM
    CS2009 Training, Europe and North America: http://www.software-smith.com/
    CS2007 book: http://www.software-smith.com/csbook
    2011年7月21日 9:21
  • Problem is solved, posting back in case anybody else needs it.

    Part of installation was to create a web application, There was a section about it in the installation guide and thought it was usual yadayada, but it turned out that the web app should be created with claim-based authentication and custom provider. This can be done manual or with wizard. I chose wizard and the problem went away. So if you have default web app, it won't work...

    -Stan

    • 回答としてマーク Stan B 2011年7月21日 12:37
    2011年7月21日 12:37