locked
Asp Net Membership 4.0 to 4.5.2 RRS feed

  • Question

  • User-1835835255 posted

    I'm trying to upgrading my website from 4.0 to 4.5.2.  I created a new user account with ASP.Net Membership in 4.5.2 and everything works fine.  I can now login correctly, but I have a whole lot of users who created their accounts under the old asp.net 4.0 framework which no longer works (can't login) when the website trys to fetch the information it's null.

    Though I try to loginto my old website under asp.net framework 4.0 with my newly created asp.net 4.5 user account and it doesn't work.  I use the same connection string in both websites to access the same database.

    I just found the user I created in my database, it created a new table in AspNetUsers in asp.net 4.5 the old user accounts table was aspnet_users in asp.net 4.0

    1) so how do I migrate my users from aspnet_users to --> aspnetusers

    2) So when I migrate to my aspnet 4.5 website how do the old users in aspnet_users login when it login from aspnetusers table, how do the old users from 4.0 login to 4.5

    I get the following error

    Object reference not set to an instance of an object.
    
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
    
    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
    
    Source Error: 
    
    
    Line 29: 
    Line 30:         string username = lbButton.Text;
    Line 31:         if (Membership.GetUser(username).IsApproved == true)
    Line 32:         {
    Line 33:              Session["LoggedIn"] = lbButton.Text.Trim();

    Friday, May 13, 2016 4:32 AM

Answers

All replies

  • User-646145796 posted

    Hi,

    The error message tell us that the application could not get the user information. Based on your testing, it is caused by 4.5.2 create a new user table, please try migrate aspnet_users data to aspnetusers to see whether it works.

    Regards

    Monday, May 16, 2016 8:46 AM
  • User-1835835255 posted

    What you are telling me to do, is what my question is, and what I am trying to figure out.

    Monday, May 16, 2016 2:40 PM
  • User-2057865890 posted

    Hi Chjones2008,

    The ASP.NET Identity system is designed to replace the previous ASP.NET Membership and Simple Membership systems.

    Migrating an Existing Website from SQL Membership to ASP.NET Identity

    This tutorial illustrates the steps to migrate an existing web application with user and role data created using SQL Membership to the new ASP.NET Identity system. 

    Best Regards,

    Chris

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, May 30, 2016 10:57 AM