+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Enabling Role Provider Causes Exception

Enabling Role Provider Causes Exception

2 posts, 0 answered
  1. Rick
    Rick avatar
    12 posts
    Registered:
    21 Sep 2007
    20 Dec 2010
    Link to this post
    I have some working code that makes use of the System.Web.Security.Roles.Provider that requires me to enable the role provider in web.config.

    I have configured the role provider thusly:

    <roleManager enabled="true" defaultProvider="Sitefinity">
        <providers>
            <clear/>
            <add name="Sitefinity" type="Telerik.Sitefinity.Security.Data.SitefinityRoleProvider, Telerik.Sitefinity" />
        </providers>
    </roleManager>

    In my VS 2010 test project, I created a simple TestPage.aspx page with the following single statement in the Page_Load method:
    protected void Page_Load(object sender, EventArgs e)
     {
         bool isadmin = System.Web.Security.Roles.Provider.IsUserInRole("admin", "administrators");
     }

    I make this page my default start page for the project and run it. The following exception occurs before Page_Load even executes:

    Type 'Telerik.Sitefinity.Security.SitefinityIdentity' in assembly 'Telerik.Sitefinity, Version=4.0.992.0, Culture=neutral, PublicKeyToken=b28c218413bdf563' is not marked as serializable.

    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.Runtime.Serialization.SerializationException: Type 'Telerik.Sitefinity.Security.SitefinityIdentity' in assembly 'Telerik.Sitefinity, Version=4.0.992.0, Culture=neutral, PublicKeyToken=b28c218413bdf563' is not marked as serializable.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [SerializationException: Type 'Telerik.Sitefinity.Security.SitefinityIdentity' in assembly 'Telerik.Sitefinity, Version=4.0.992.0, Culture=neutral, PublicKeyToken=b28c218413bdf563' is not marked as serializable.]
       Microsoft.VisualStudio.WebHost.Connection.get_LocalIP() +0
       Microsoft.VisualStudio.WebHost.Request.GetLocalAddress() +65
       Microsoft.VisualStudio.WebHost.Request.GetServerName() +38
       System.Web.HttpRequest.get_Url() +140
       System.Web.HttpRequestWrapper.get_Url() +11
       System.Web.UI.ControlExtensions.IsBackend(Control control) +252
       System.Web.UI.ControlExtensions.IsBackend() +25
       Telerik.Sitefinity.Web.SitefinityRoute.GetRouteData(HttpContextBase httpContext) +504
       System.Web.Routing.RouteCollection.GetRouteData(HttpContextBase httpContext) +285
       System.Web.Routing.UrlRoutingModule.PostResolveRequestCache(HttpContextBase context) +60
       System.Web.Routing.UrlRoutingModule.OnApplicationPostResolveRequestCache(Object sender, EventArgs e) +86
       System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
    
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    20 Dec 2010
    Link to this post
    Hello Rick,

    Currently you cannot use the standard ASP.NET Role, Membership and Profile provider in Sitefinity 4.0/ Please take a look at this post.

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered