-
-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid object name 'Application' #44
Comments
Have you tried the samples? |
I have not, i wanted to start with a clean project to start with, so i could follow everything. I can try a sample project, which one do i need, Server or Client? |
Right, i have narrowed the problem down, and found out what is causing the error. Not sure if this is my mistake, or whether the readme file needs to be updated. In a default webApplication, this appears in the startup.cs file.
I have not got my site in development mode, so it is calling the Database.Migrate() method. I am not sure why the Application table is not created, because this is being called, but this is the reason. Can someone shed some light on this?? I havent used EF7 yet, so not sure what is right/wrong |
Make sure your application DataSet is inside your ApplicationDbContext and the OnModelCreating has code to create the application table. If database already exists, you need create the migration code as well. |
Dbset added as tried inheriting from openid context as well as using own Database didnt exist so would expect Application table to be created like
|
This was an issue with the DI. All sorted now |
Can you explain how you sorted it out? Tried with new project and run the examples but still getting the same error. Invalid Applications object. Thanks |
Might exists a better solution, but this fixed the issue: public class ApplicationDbContext : IdentityDbContext
Hopefully this can help others. |
Thanks, I read the readme and it did help resolving the issue; however the readme does not mention if inheriting from OpenIddictContext the Applications table will not be created. Which is the issue reported. |
Hum weird. Are you sure you didn't have a pre-existing database before updating your context class to inherit from |
I have finally got my application running on rc2 (brand new web application so i can test your software).
Now i have followed all the steps on the readme and my project builds. Problem is that this run in my startup.cs file is causing an error.
if (!context.Applications.Any())
When this line executes my sql database is created, but the Application table is completely missing? I have deleted my database and started again multiple times, but it never gets created. I have tried both database setup options, inheriting from
OpenIddictContext
and including the Application DbSet on an existingIdentityDbContext
object. Neither seem to work??I am using SQLServer, here is an example of my connectionString, which i believe is fine
"ConnectionString": "Server=(local);Database=OpenIdDictDb;Trusted_Connection=True;"
Here is an image of my database tables, as you can see the Application table is not created.
The text was updated successfully, but these errors were encountered: