Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the diff between dbo.aspnet_Users and dbo.aspnetUsers?

VS 2013, Framework 4.5.1 ...

I ran Aspnet_regsql.exe to create the schema. It created the tables with an underscore in them: aspnet_Users for example. It also created the associated stored procedures. Those stored procedures do work and they add records to the tables: a user is added to aspnet_Users, for example.

When I try to use Login.aspx, it crashes on the manager.Find with the error: "Invalid object name 'dbo.AspNetUsers'."

    protected void LogIn(object sender, EventArgs e)
    {
        if (IsValid)
        {
            // Validate the user password
            var manager = new UserManager();
            ApplicationUser user = manager.Find(UserName.Text, Password.Text);
            if (user != null)
            {
                IdentityHelper.SignIn(manager, user, RememberMe.Checked);
                IdentityHelper.RedirectToReturnUrl(Request.QueryString["ReturnUrl"], Response);
            }
            else
            {
                FailureText.Text = "Invalid username or password.";
                ErrorMessage.Visible = true;
            }
        }
    }
like image 412
nicomp Avatar asked May 31 '14 02:05

nicomp


1 Answers

The authentication model changed between .Net VS2012 and VS2013, hence the AspNetDB tables and table structures, e.g.

dbo.aspnet_Users become dbo.AspNetUsers with totally different designs and rules (e.g. hyphen forbidden in Username)

like image 195
yazan_ati Avatar answered Oct 22 '22 12:10

yazan_ati