Is it o.k. to use aspnet_regsql in a web app created using Visual Studio 2022

DKB 21 Reputation points
2023-06-26T02:04:06.1666667+00:00

I want to create a web app and I want to use aspnet_regsql which I have experience with from the earlier years. I just don't have the energy to put into learning the newer ways of creating membership and rolls unless someone can show me the it is much easier than the past, because when I look at what is available it seems also different and complicated. Perhaps it is just the lack of quality lessons.

Dbarselow

Developer technologies ASP.NET Other
0 comments No comments
{count} votes

Accepted answer
  1. Albert Kallal 5,586 Reputation points
    2023-06-27T03:52:50.16+00:00

    As pointed out, the script still does exist.

    However, if you create a new vb.net "webforms" project?

    It can (and will) build up the data base for you. And that database MUCH follows the same format as the older asp.net "webforms" authenticaiton. Older templates did use what is called FBA (forms based authentication).

    However, the newer "owin" system? You not notice the difference anyway.

    I suggest (assuming vs2022 - the free community edition) that you try a working template. The database will be created for you, and you don't even have to run some script. (it is automatic created for you).

    So, create a new project, vb.net, asp.net, .net framework.

    This project choice:

    User's image

    And then to have the "logon" data base created for you, then after above, choose this option:

    User's image

    So, above will create a database, and the database follows VERY much and close to how the previous FBA (logon database) worked.

    I would suggest you find some tutorials, even perhaps you-tube ones. Or get a book. So, if it has been some time, then the efforts and "dance" to get the FBA and that aspnet_regsql "sql script" creator is not really required.

    With above template, then the database created is VERY close to that older setup. You get/see this for the database, and it is created automatic for you:

    User's image

    So, the old FBA system had users, roles, user in roles. It really is VERY close to what you had, but you don't have to go dig around and run that aspnet_regsql thing anyway.

    Now to be fair, the "moving" parts in the older system, or above? It is about the same, and the less you worry about the above user logon database , the better. In other words, just let the system create the database of logons for you.

    I think about the only "possible" reason to use the older FBA system is that if you have a existing database of users and want to use a "different" table then the default table created for users. However, that table of users and how this works as noted is rather close to the older system anyway.

    I currently run one site with FBA logons, and without question the roles and users etc. was created using that aspnet_regsql to create the logon tables, but I can't see it much of a issue to adopt the new default setup, since out of the box is works and is automatic setup for you. So, pick the above "individual accounts", and the result is very much like the older system and "logon database" used.

    My suggestion is in fact to get/grab/move that database created in the project into SQL server express (assuming you installed and setup that on your local PC for development and testing). This will require you change the connection strings in web.config, but after doing that, then the setup is even MORE like the older FBA system anyway.

    Both systems (older FBA, or newer owin) do and did require quite a bit of setup, but the template will setup all of this for you out of the box without any efforts on your part.


1 additional answer

Sort by: Most helpful
  1. Lan Huang-MSFT 30,186 Reputation points Microsoft External Staff
    2023-06-26T05:56:07.6633333+00:00

    Hi @DKB,

    aspnet_regsql is currently available. Aspnet_regsql.exe is installed in the Microsoft.NET Framework directory.

    But the contents of aspnet_regsql and membership are no longer updated. The latest approach is ASP.NET Identity.

    ASP.NET Identity Recommended Resources

    The ASP.NET Identity system is designed to replace the previous ASP.NET Membership and Simple Membership systems. It includes profile support, OAuth integration, works with OWIN, and is included with the ASP.NET templates shipped with Visual Studio 2013.

    User's image

    Best regards,
    Lan Huang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.