Error with ASPNET RoleProvider

I just installed my application on win2003 server and I am getting this error:

Line 149:    <roleManager>
Line 150:      <providers>
Line 151:        <add name="AspNetSqlRoleProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
Line 152:        <add name="AspNetWindowsTokenRoleProvider" applicationName="/" type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
Line 153:      </providers>


Source File: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config    Line: 151 

      

I am using RoleProvider and configured correctly in web.config (it works on other servers) like this:

<membership defaultProvider="AdminMembershipProvider">
  <providers>
    <clear/>
    <add name="AdminMembershipProvider" connectionStringName="SiteSqlServer" type="MyApp.Providers.AdminMembershipProvider" applicationName="MyApp" writeExceptionsToEventLog="false" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" PasswordFormat="Clear" MinRequiredNonAlphanumericCharacters="1" MinRequiredPasswordLength="8" MaxInvalidPasswordAttempts="5" PasswordAttemptWindow="10">
    </add>
  </providers>
</membership>
<roleManager enabled="true" defaultProvider="AdminRoleProvider" cacheRolesInCookie="true">
  <providers>
    <add name="AdminRoleProvider" type="MyApp.Providers.AdminRoleProvider" writeExceptionsToEventLog="true"/>
  </providers>
</roleManager>

      

Any hint as to why it is looking for config on machine.config instead of web.config? How can I debug this?

Thank.

0


source to share


2 answers


Indeed, it reads the machine.config file first, and then your web.config, which overloads the machine.config. But in some cases the values ​​in the web.config file are added or included in the list, so it can be a little tricky to follow.



But looking at the machine.config file on a production server might shed some light for you.

+1


source


Machine.Config contains settings that are specific to the entire computer. Several Machine.Config elements allow you to override them. If the element has an attribute allowOverride = "true"

, it can be overridden by web.config. However, if it works on other machines, I would look at the differences in the machine.config files.



Be aware that it is generally not recommended to edit esp machine.config. if you plan to deploy to multiple machines.

+1


source







All Articles