IdentityServer4 icon indicating copy to clipboard operation
IdentityServer4 copied to clipboard

Error: SqlException: Invalid object name 'Clients' in Identity Server 4 Project

Open gauravawr opened this issue 9 years ago • 5 comments

I would like to connect Identity Server to the Sql Server in my Asp.net core AuthServer project. But I am getting the error in the InitlizeDatabase(app) step as shown in the image below.

identityserver-error

gauravawr avatar Feb 01 '17 21:02 gauravawr

Does Migrate not create the DB for you?

brockallen avatar Feb 02 '17 12:02 brockallen

Did you create the initial migrations? Does the folder Data/Migrations/IdentityServer exist in your IdSrv project, and does it have the two initial migrations in it?

EdwardBlair avatar Feb 02 '17 18:02 EdwardBlair

When I do "Add-Migration first" then comes the "Build Failed" Error. But I can run the project, if the comment out the InitializeDatabase(app) line, without error.

As the migration command is failing, so the migrations did not occur therefor the migrations folder is not created.

I have attached the config file as below:

identityserver-error-config

gauravawr avatar Feb 02 '17 19:02 gauravawr

It was the EF version issue.

When I used the ef and the ef tool version as given in the documentation and it worked :)

So my code works with the version below: "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final"

gauravawr avatar Feb 02 '17 20:02 gauravawr

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Jan 15 '20 02:01 lock[bot]