Home > other >  migration erorr in asp.net mvc
migration erorr in asp.net mvc

Time:12-27

[why this erorr[enter image description here](https://i.stack.imgur.com/ntWwk.png)](https://i.stack.imgur.com/Hpxgh.png)

i want to add migration

Unable to create an object of type 'AppDbContext'. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728

CodePudding user response:

For a better description of the error you are getting add the following parameter -verbose to the add-migration command. Full command: add-migration Initial -verbose

That should give you a more detailed error description of what the problem is.

CodePudding user response:

Try these steps:
1- Make sure setting your project as Startup Project.
2- In Package Manager Console, set your data access layer (if any) as a default project
Now try agian and see what happens. Besides, you can read the given link from the message and check what's wrong with your code.

In fact, we need more detailed information about your issue, like what happened while you tried to run the command and what troubleshooting step you have already done. Showing some codes will be helpful here.

  • Related