title: Asp.net membership WebSecurity.InitializeDatabaseConnection error
body: <p>When i'm trying to get to Web Site Administration Tool (WAT) (Project->ASP.NET Configuration in Visual Studio) i get following error</p>
  
  <blockquote>
    <p>You must call the "WebSecurity.InitializeDatabaseConnection" method before you call any other >method of the "WebSecurity" class. This call should be placed in an _AppStart.cshtml file in >the root of your site.</p>
  </blockquote>
  
  <p>And this is my connection string:</p>
  
  <pre><code>&lt;add name="DefaultConnection" connectionString="Data Source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|Database1.mdf;User Instance=true" providerName="System.Data.SqlClient" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>I've also enabled simple membership</p>
  
  <pre><code>&lt;add key="enableSimpleMembership" value="true" /&gt;
  </code></pre>
  
  <p>My roleshipprivider config looks like this</p>
  
  <pre><code>&lt;roleManager enabled="true" defaultProvider="MySqlRoleProvider"&gt;
    &lt;providers&gt;
      &lt;clear /&gt;
      &lt;add connectionStringName="DefaultConnection" applicationName="/"
        name="MySqlRoleProvider" type="WebMatrix.WebData.SimpleRoleProvider, WebMatrix.WebData" /&gt;
    &lt;/providers&gt;
  &lt;/roleManager&gt;
  </code></pre>
  
  <p>And my membership conf</p>
  
  <pre><code> &lt;membership defaultProvider="MyOwnSqlMembershipProvider"&gt;
    &lt;providers&gt;
      &lt;clear/&gt;
      &lt;add connectionStringName="DefaultConnection" enablePasswordRetrieval="false"
        enablePasswordReset="true" requiresQuestionAndAnswer="false"
        requiresUniqueEmail="true" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6"
        minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
        name="MyOwnSqlMembershipProvider" type="WebMatrix.WebData.SimpleMembershipProvider, WebMatrix.WebData" /&gt;
    &lt;/providers&gt;
  &lt;/membership&gt;
  </code></pre>
  
  <p>Does anybody know where's the bug?</p>
  
  <p>Thanks in advance, Mateusz Urban</p>