title: Membership provider properties not being read from web.config
body: <p>I'm having a problem with a custom Membership implementation for ASP.NET using EF. The thing is, my web.config features the default values for the provider but at runtime those default are only being read in Initialize() the first time provider is instantiated (that happens for instance when I request the Register view via GET but when I fill in the form and POST to the controller the Initialize() on the provider class doesn't get called and all the provider settings are null or default value types value.</p>
  
  <p>This is my web.config section:</p>
  
  <pre><code>    &lt;membership&gt;
          &lt;providers&gt;
              &lt;clear /&gt;
              &lt;add name="AspNetSqlMembershipProvider"
                   type="BN.Membership.EfMembershipProvider, BN"
                   connectionStringName="ApplicationServices"
                   enablePasswordRetrieval="false"
                   enablePasswordReset="true"
                   requiresQuestionAndAnswer="false"
                   requiresUniqueEmail="true"
                   maxInvalidPasswordAttempts="5"
                   minRequiredPasswordLength="6"
                   minRequiredNonalphanumericCharacters="0"
                   passwordAttemptWindow="10"
                   applicationName="/" /&gt;
          &lt;/providers&gt;
      &lt;/membership&gt;
      &lt;roleManager enabled="false"&gt;
          &lt;providers&gt;
              &lt;clear /&gt;
              &lt;add name="AspNetSqlRoleProvider"
                   type="BN.Membership.EfRoleProvider, BN"
                   connectionStringName="ApplicationServices"
                   applicationName="/" /&gt;
          &lt;/providers&gt;
      &lt;/roleManager&gt;
  </code></pre>
  
  <p>Since my provider class is quite huge I am not posting it here but will post some parts of it if requested.</p>