简体   繁体   中英

ASP.NET Membership Provider, not configured correctly - cannot open websit administration tool

I installed ASP.NET Membership tables into a remote database using aspnet_regsql.exe. It seems to have successfully created all the tables in the database that I've seen created in the past when working with this technology. aspnet_regsql also say that the process completed successfully.

I am able to connect to the database fine with sql server management studio and execute queries. I have my web.config file set up containing the relevant settings as shown below.


<connectionStrings>
    <add name="ApplicationServices" connectionString="Data Source=**********;Initial Catalog=********;Integrated Security=false;User ID=*************;Password=******" providerName="System.Data.SqlClient" />
  </connectionStrings>

<membership>
      <providers>
        <clear/>
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices"
             enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
             maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
             applicationName="/" />
      </providers>
    </membership>

    <profile>
      <providers>
        <clear/>
        <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" />
      </providers>
    </profile>

    <roleManager enabled="false">
      <providers>
        <clear/>
        <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
        <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
      </providers>
    </roleManager>

I know the connection to the database works. The connection string is correct. Yet, when I go into the website administration tool to start configuring security I get an error saying:

There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store.

The following message may help in diagnosing the problem: Could not load type 'PVN.Web.MvcApplication'.


So yes, this is an MVC3 application I'm attempting to build. And the name of the web application project is called PNV.Web, but I have no idea what 'PVN.Web.MvcApplication' is.

Any help on this would be greatly appreciated.

Thanks

So it looks like my problem was that my role manager was set to false.

<roleManager enabled="false">

Once I set it to true, I was able to use the Website configuration tool with no problems and everything seemed to start working.

<roleManager enabled="true">

Did you compile the application before attempting to use the website administration tool? It will not work before the site has been compiled.

Your application name is not set:

applicationName="/" />

Set the application name and make sure it matches the name in the Application table in your database. Good luck.

My default Membership Provider worked, but I changed the name of the application in aspnet_Applications table. If you do that, you need to change the applicationName in web.config, too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM