title: I have added a user and assigned him to a role, when i use Membership.GetAllUsers() it returns none
body: <p><em>Side note: I am using vs2013 express and have installed nothing else.</em></p>
  
  <p>I am building an <strong>intranet site</strong> with the following authentication/authorisation goals:</p>
  
  <ul>
  <li>Custom roles using the Roles class</li>
  <li><strong>No need for logging in</strong>, if you are signed into windows, then you're allowed to see the app</li>
  <li>Be able to use [Authorise(Roles="Admin")] kind of attributes</li>
  <li>Be able to manage the Users (Create/Delete/List/Edit) from a UserManagement page.</li>
  </ul>
  
  <p>I have been following this: <a href="http://weblogs.asp.net/scottgu/archive/2006/07/23/Recipe_3A00_-Implementing-Role-Based-Security-with-ASP.NET-using-Windows-Authentication-and-SQL-Server.aspx" rel="nofollow noreferrer">http://weblogs.asp.net/scottgu/archive/2006/07/23/Recipe_3A00_-Implementing-Role-Based-Security-with-ASP.NET-using-Windows-Authentication-and-SQL-Server.aspx</a></p>
  
  <p>but i'm not sure how to Create / List out the users... this is what I have so far:</p>
  
  <p>I have added a user and assigned him to a role, when i use Membership.GetAllUsers() it returns none</p>
  
  <p><strong>Web.config bits:</strong></p>
  
  <pre><code>&lt;authentication mode="Windows"&gt;&lt;/authentication&gt;
  
  &lt;authorization&gt;
    &lt;deny users="?" /&gt;
  &lt;/authorization&gt;
  
  &lt;roleManager enabled="true" defaultProvider="SqlRoleManager"&gt;
    &lt;providers&gt;
      &lt;clear/&gt;
  
      &lt;add name="SqlRoleManager"
           type="System.Web.Security.SqlRoleProvider"
           connectionStringName="EFDbContext"
           applicationName="TEST" /&gt;
  
    &lt;/providers&gt;
  &lt;/roleManager&gt;
  
  &lt;membership defaultProvider="SqlProvider"
    userIsOnlineTimeWindow="15"&gt;
    &lt;providers&gt;
      &lt;add
        name="SqlProvider"
        type="System.Web.Security.SqlMembershipProvider"
        connectionStringName="EFDbContext"
        applicationName="TEST"
        enablePasswordRetrieval="false"
        enablePasswordReset="true"
        requiresQuestionAndAnswer="true"
        requiresUniqueEmail="false"
        passwordFormat="Hashed"
        maxInvalidPasswordAttempts="5"
        passwordAttemptWindow="10" /&gt;
    &lt;/providers&gt;
  &lt;/membership&gt;
  </code></pre>
  
  <p>I added my first user in Global.asax like this:</p>
  
  <pre><code>        if(!Roles.RoleExists("Admin"))
          { 
              Roles.CreateRole("Admin");
              Roles.AddUserToRole(@"JIMMYT1988\jimmyt1988", "Admin");
          }
  </code></pre>
  
  <p>The user and role is working because if I block access to Admin, I'm allowed in.. whereas if I created the user without adding the role, he wasn't allowed access... so that's all good and working.</p>
  
  <p>this is me blocking access to only role of Admin:</p>
  
  <pre><code>[Authorize(Roles = "Admin")]
  public class UserController : Controller
  {
      private IUserRepository repository;
  
      public UserController(IUserRepository repo)
      {
          repository = repo;
      }
  
      public PartialViewResult List()
      {
          IEnumerable&lt;User&gt; users = repository.Users;
  
          UserListViewModel viewModel = new UserListViewModel();
          viewModel.Users = users;
          viewModel.TotalUsers = Membership.GetNumberOfUsersOnline().ToString();
  
          return PartialView(viewModel);
      }
  }
  </code></pre>
  
  <p>So I am assuming the user and role of admin are working correctly and I can see the entires in the database... The above controller is part of an abstract -> concrete mapping for specifically membershipprovider users... but I have debugged on the GetAllUsers line and that actually returns the empty list, it's not the mapping going wrong.</p>
  
  <p>Finally I call this:</p>
  
  <pre><code>            MembershipUserCollection users = Membership.GetAllUsers();
  </code></pre>
  
  <p>which returns no users.</p>
  
  <p>Any idea?</p>
  
  <p><img src="https://i.stack.imgur.com/O2qfW.jpg" alt="enter image description here"></p>