title: Asp.net Web Site Administration Tool using wrong database
body: <p>I have an ASP.Net web-forms application that uses membership functionality.
  I have created the required database using the aspnet_regsql.exe tool on a <strong>remote</strong> server. 
  Now, if I use the Web Site Administration Tool to define roles, I experience the following things:</p>
  
  <ul>
  <li>I can see the users I've created programatically (Membership.CreateUser(...))</li>
  <li>I can define new roles and they are stored somewhere</li>
  <li>I can not assign a user to a role (error: "User X was not found"). When I check the remote membership database, the roles-table is empty.</li>
  </ul>
  
  <p>I have investigated the problem and it seems that the roles are being stored in an *mdf database file on the <strong>local</strong> machine in the App_Data folder. This might be due to the fact that the tool uses the machine.config file along with the web.config file.</p>
  
  <p>My web config looks like this:</p>
  
  <pre><code>&lt;connectionStrings&gt;
  &lt;add name="userManagementConnectionString" connectionString="Data Source=myIp\SQLEXPRESS;Integrated Security=False;User ID=myUser;Password=myPW;Connect Timeout=15;Encrypt=False;TrustServerCertificate=False"/&gt;
  
  &lt;add name="securityConnectionString" connectionString="Data Source=myIp\SQLEXPRESS;Initial Catalog=IsapMemberShip;Integrated Security=False;User ID=myUser;Password=myPW;TrustServerCertificate=False" providerName="System.Data.SqlClient" /&gt;
  &lt;/connectionStrings&gt;
  
  &lt;profile defaultProvider="DefaultProfileProvider"&gt;
    &lt;providers&gt;
      &lt;add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="securityConnectionString" applicationName="/" /&gt;
    &lt;/providers&gt;
  &lt;/profile&gt;
  
  
  &lt;membership defaultProvider="isapMembershipProvider"&gt;
    &lt;providers&gt;
      &lt;add name="isapMembershipProvider"
      type="System.Web.Security.SqlMembershipProvider"
      connectionStringName="userManagementConnectionString" 
      ...      &lt;/providers&gt;
  &lt;/membership&gt;
  
  
  &lt;roleManager enabled="true" defaultProvider="DefaultRoleProvider"&gt;
    &lt;providers&gt;
      &lt;add connectionStringName="securityConnectionString" applicationName="/"
        name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /&gt;
    &lt;/providers&gt;
  &lt;/roleManager&gt;
  
  
  &lt;sessionState mode="InProc" customProvider="DefaultSessionProvider"&gt;
    &lt;providers&gt;
      &lt;add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="securityConnectionString" /&gt;
    &lt;/providers&gt;
  &lt;/sessionState&gt;
  </code></pre>
  
  <p>U can see that I'm using 2 different connection strings (one for user storage, one for the rest). However, both refer to the same database on the same server.
  I've also tried to use only the "securityConnectionString", but no success here (then, the tool doesn't even find the users).</p>
  
  <p>So...does anybody know how I can make the tool (and my application) use the same remote database for all membership-purposes?</p>