Last post Apr 21, 2017 12:16 AM by Robotuner
Apr 19, 2017 10:42 PM|Robotuner|LINK
I'm learning asp.net core and have run into a problem with migrations. from the cli I can enter:
dotnet ef migrations add InitialCreate
it appears to work. Then I can enter
dotnet ef migrations add IdentityClasses
and that appears to work, . . . . meaning I can see the the files created in the Migrations folder. The problem is that I can't find the database in my sql server object Explorer window. I can't see it in ssms either.
My connection string is "Server=(localdb)\\MSSQLLocalDB;Database=GLCoreDB;Trusted_Connection=True;MultipleActiveResultSets=true;"
When I look at my SQL Server Object Explorer their is a (localdb)\MSSQLLocalDB (SQL Server 13.0.42-2 - xxxxx\sssss)
What happened to the database?
Apr 19, 2017 10:55 PM|jsiahaan|LINK
Have you submit the following command?
dotnet ef database update
If not, do it so.
Every time you add a new migration, you need to do the same command to update the database.
Apr 19, 2017 11:31 PM|Robotuner|LINK
I wish it were that easy. I have, and it doesn't change anything.
Apr 20, 2017 05:52 AM|Edward Z|LINK
Did you get Build succeeded result after run dotnet command?
Could you share us the related code with “services.AddDbContext”?
I suggest you follow below link step by step.
#Migrations - EF Core with ASP.NET Core MVC tutorial (4 of 10)
If you still could not make it work, it would be helpful if you could share us your simple project, and then we could try to make a test.
Apr 21, 2017 12:16 AM|Robotuner|LINK
Thanks, the link that you provided didn't really solve my problem. Instead I found the links below that clarified what asp.net core is doing with identity and how dotnet ef fits in.
https://identityserver4.readthedocs.io/en/release/quickstarts/6_aspnet_identity.html is the one that resolved my immediate need and
is the reference that resolved what would have been my next question.