Creating the Authentication Database for SQL Server LocalDB
Learn about configuring authentication databases in ASP.NET Core MVC, with specific instructions for creating databases in Visual Studio 2022 and relevant migration commands.
SQL Server local db configuration
If we created the MVC project using Visual Studio 2022 or used dotnet new mvc
with the -uldor
--use-local-db
switch, then the database for authentication and authorization will be stored in SQL Server LocalDB. However, the database does not yet exist.
SQLite authentication database configuration
If we created the MVC project using dotnet new
, then the database for authentication and authorization will be stored in SQLite, and the file has already been created, named app.db
. The connection string for the authentication database is named DefaultConnection
, and it is stored in the appsettings.json
file in the root
folder for the MVC website project.
For SQLite, see the following setting:
Get hands-on with 1400+ tech skills courses.