It seems that the EF Core migration for the identity schema hasn't been correctly applied to the app.db that we generate with the Blazor Web App template when auth with ASP.NET Core Identity is enabled. If you try to update the database using the template included migration you get an error that the identity tables are already there.
Repro steps:
- Install .NET 10 SDK
dotnet tool install --global dotnet-ef
dotnet new blazor -au Individual
dotnet ef database update
Expected result: Updating the database works without errors
Actual result: Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 1: 'table "AspNetRoles" already exists'.
Workaround:
- Delete the app.db that comes with the template.
- Run
dotnet ef database update to regenerate it.
- Running
dotnet ef database update again succeeds without error.