stavroskasidis / BlazorWithIdentity

A project template for a blazor hosted app using cookie based authentication with ef core identity.
MIT License
458 stars 106 forks source link

Using Sql Server as the Database #23

Closed silentcross closed 3 years ago

silentcross commented 3 years ago

I try to change the sqlite to sql server, but got error 500 Step i done :

  1. Adding Microsoft.EntityFrameworkCore.SqlServer
  2. Change :services.AddDbContext<ApplicationDbContext>(options => options.UseSqlite("Filename=data.db")); to services.AddDbContext<ApplicationDbContext>(options => options.UseSqlServer(connString));

When i register, the input username & password is inserted to database, but it say error 500 I cant login

stavroskasidis commented 3 years ago

I did the same and I don't see any errors, everything worked fine. What is the exact error message you get?

silentcross commented 3 years ago

It say Response status code does not indicate success: 500 (Internal Server Error).

update : thanks for your respond, it seems that the database structure that make the error, i use already made database with aspnetuser generated from default blazor, when is use your migration, it work.