locked
Provider must implement the class 'System.Web.Profile.ProfileProvider'. RRS feed

  • Question

  • User1010943358 posted

    I currently have web site running custom role, membership, and profile providers.
    I also have a Windows Application calling these custom provider services.
    This has been working fine for years.

    Now I have a request to build a ASP.NET web application that can call the current custom role, membership, and profile service.
    I my web application I was able to set the web.config to call the Authentication_JSON_AppService.axd and Role_JSON_AppService.axd just fine and both IsInRole and IsAuthenticated is working fine on the new ASP.NET web application calling my old custom role and membership service.

    The Profile_JSON_AppService.axd is not working. 
    When I call HttpContext.Current.Profile I get "Provider must implement the class 'System.Web.Profile.ProfileProvider'." error.

    Sunday, July 13, 2014 3:50 PM

All replies

  • User-1818759697 posted

    Hi,

    There are two kinds of project in Visual Studio -- "Web Site Projects" and "Web Application Projects." For reasons which are a complete mystery to me, Web Application Projects cannot use Profile. directly... the strongly-typed class is not magically generated for you from the Web.config file, so you have to roll your own.

    The sample code in MSDN assumes you are using a Web Site Project, and they tell you just to add a <profile> section to your Web.config and party on with Profile. property, but that doesn't work in Web Application Projects.

    For more informatin, you could refer to:

    http://stackoverflow.com/questions/426609/how-to-assign-profile-values

    http://www.hanselman.com/blog/IntroducingSystemWebProvidersASPNETUniversalProvidersForSessionMembershipRolesAndUserProfileOnSQLCompactAndSQLAzure.aspx

    http://weblogs.asp.net/jongalloway/writing-a-custom-asp-net-profile-class

    Regards

    Tuesday, July 15, 2014 4:35 AM
  • User1010943358 posted

    The answer you listed would be correct if I was only using 1 web application.

    Let me better explain. I have 2 web applications. The first web application has been running for years and contains a working Membership, Role, and Profile provider.
    I have a second web application that needs to call the first web applications Membership, Role, and Profile provider.
    On the second web application I was able to connect to the first web applications Membership and Role provider with little to no problem by adding the following settings in the first applications web.config 

    authenticationService enabled="true"
    roleService enabled="true"
    profileService enabled="true"
    

    The second web application is calling the "authentication and role service" but I can't find any article on how to call the "Profile service".

    Friday, July 18, 2014 6:27 PM
  • User-881099725 posted

    Yes, that Is also a mystery to me, if they had implemented (years have passed since) rather than omitting it, it would be easier to migrate from one to other and tons of support questions would never had existed. That built in profile stuff was kind of a productivity aid, without it you have to spend time reinventing the wheel.

    Tuesday, July 22, 2014 1:25 PM