Brain Spew - Neville Mehta's Blog

Friday, January 26, 2007

Cannot get Membership Provider with name [MembershipProvider name] error in SharePoint 2007 / WSS 3

Ive been doing some work with MOSS 2007 lately and came across this error:

Cannot get Membership Provider with name [MembershipProvider name]. The membership provider for this process was not properly configured. You must configure the membership provider in the .config file for every SharePoint process.

Just to save someone else the time of figuring out what the problem is, I thought I would let you know that the reason this is happening is because when you use a membership provider in SharePoint 2007 (or WSS 3) you must add the details about the membership provider in the web.config of the site you have created AS WELL AS in Central Admin so you can create site collection administrators etc.

Labels: , , ,

3 Comments:

  • I am trying to setup my custom membership and roles providers to use with forms authentication. I have managed to get the authentication working (when it wants, I got errors time to time saying that it could not find the role provider assembly) Anyway I have configured the providers for both my site and the central admin site but still I could not look up my users and got the same error you mention. Any idea? The sharepoint server runs about 4 sites; do I need to change the .config of these 4 sites too? Any chance you can publish how you configure the config file?

    By Blogger Julien Jacobs, at 10:34 pm  

  • No, you shouldnt have to change the .config of the other sites, it should only be the one that requires the providers and the central admin. I dont have the exact config that I used with me right now, but this site (http://www.odetocode.com/Articles/428.aspx) has the correct configuration information. It sounds like you may have two problems here, the first one being that it cant find your role provider assembly sometimes and the second being that there maybe a problem with your configuration. For the first problem, make sure that your role provider is in the bin directory of your site, or if you are using the GAC, make sure you use a full qualified assembly name (that is, including version, culture and public key token).
    For the second problem, make sure that for the admin site, you have put the membership configuration in the correct system.Web element as there are several due to different locations. From memory (I dont have a machine with SharePoint with me right now) it will be the first system.Web element that appears in the config file. Also, as a sanity check, make sure the users actually do exist in the database :-) Have you tried debugging your membership provider and making sure that everything runs correctly?

    By Blogger Nev, at 11:42 am  

  • Hello, Can I have multiple Membership Providers ?
    AspNetSqlMembershipONE, AspNetSqlMembershipTWO, AspNetSqlMembershipTHREE

    Each of the providers belongs to a different site that lives in a different web application from the other Providers? I added the connection strings of each provider in the central admin web config as well in the web config of the different sites, changed the authentication method to forms of each site and included the name of the provider in the people wild cards in each web config, but I cannot find any user, if I changed the name of one of the providers to "AspNetSqlMembershipProvider" then I can find users. Do you have any idea why is this happening?

    Best regards,

    By Anonymous Anonymous, at 2:08 pm  

Post a Comment

<< Home