Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 4 of 4

Thread: Unable to cast object of type 'System.Web.Security.RolePrincipal'

  1. #1
    DENT is offline Member
    Join Date
    Mar 2010
    Posts
    42

    Default Unable to cast object of type 'System.Web.Security.RolePrincipal'

    Not sure what happened, but all of a sudden I am getting this error when trying to go to the shoppingcart.aspx page.


    Unable to cast object of type 'System.Web.Security.RolePrincipal' to type 'AspDotNetStorefrontCore.AspDotNetStorefrontPrinci pal'.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.InvalidCastException: Unable to cast object of type 'System.Web.Security.RolePrincipal' to type 'AspDotNetStorefrontCore.AspDotNetStorefrontPrinci pal'.

    Source Error:

    Line 213: if (HttpContext.Current != null)
    Line 214: {
    Line 215: m_ThisCustomer = ((AspDotNetStorefrontPrincipal)Context.User).ThisC ustomer;
    Line 216:
    Line 217: if (AppLogic.ProductIsMLExpress() == false && AppLogic.AppConfigBool("GoogleCheckout.ShowOnCartP age"))


    Source File: d:\Inetpub\wwwroot\Staging\XFXForce_Store\App_Code \SkinBase.cs Line: 215

  2. #2
    AspDotNetStorefront Staff - Scott's Avatar
    AspDotNetStorefront Staff - Scott is offline Administrator
    Join Date
    Mar 2007
    Location
    Ashland, OR
    Posts
    2,390

    Default

    Make sure you don't have role management enabled in IIS. You might have to have your host check on that.

  3. #3
    DENT is offline Member
    Join Date
    Mar 2010
    Posts
    42

    Default

    can I disable this in the web.config?

  4. #4
    DanV's Avatar
    DanV is offline Ursus arctos horribilis
    Join Date
    Apr 2006
    Posts
    1,568

    Default

    Replace your web.config file with the last known good backup, or extract a new copy of the web.config file from the original installation and replace your encrypt key and DBConn line with the current values. If someone tries to edit the web.config file in IIS, is mucks with a lot of stuff and breaks things.