Hi, I just purchased aspnetzero license and downloaded the code and tried to run the application but getting error at update-database command
"More than one DbContext was found. Specify which one to use. Use the '-Context' parameter for PowerShell commands and the '--context' parameter for dotnet commands."
Note : I did not modify and config settings.
7 Answer(s)
-
0
Hi vvijaydeveloper
To perform the database migration, you can set the *.Migrator project as the Startup Project and run it to create the database. The *.Migrator project is also used for other purposes. You can check the details here.
Alternatively, after opening the Package Manager Console, select the *.EntityFrameworkCore project from the Default Project dropdown menu at the top. Then, set the *.Web.Mvc or *.Web.Host project as the Startup Project through the Solution Explorer. You can update the database by entering the following command in the console:
Update-Database
or
Update-Database -Context {{YourProjectName}}DbContext
-
0
Hello Team
Same experience "More than one DbContext was found. Specify which one to use. Use the '-Context' parameter for PowerShell commands and the '--context' parameter for dotnet commands."
- The above suggestions are already in placed.
This error message/prompt only showed on the latest version - 13.4. Previous version 13.3 was ok.
Please advise and help us with this.
-
0
-
0
We have same issue pls help!
-
0
Hi @pliaspzero,
You can resolve your problem with using
-Context
flag as below:Update-Database -Context {{Your_DBContext_Name}}
-
0
I dont get this one. Why this is not updated in the documentation. https://docs.aspnetzero.com/aspnet-core-mvc/latest/Getting-Started-Core
-
0
Hi @ashgadala,
We will fix this in next version.