Replies: 1 comment
-
I actually figured this out, i had to run the migration command from the webapi folder using this command |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I have been using/demoing this template for about 6 months now and following along with the progress. We have an application that needs to be rewritten and i am hoping to use this template for that. I was excited to see Aspire had been added but having a little difficulty with migrations. I created some additional entities and wish to add them to the database. This worked fine pre Aspire. Now that Aspire is the start project, i wonder if it needs additional dependencies for the context.
This is my command
dotnet ef migrations --project ./src/infrastructure --startup-project ./tools/AppHost add AddInstitutions
and this is the error I receive in the dev powershell
Unable to create a 'DbContext' of type 'RuntimeType'. The exception 'Unable to resolve service for type 'Microsoft.EntityFrameworkCore.DbContextOptions' while attempting to activate 'Tobii.Infrastructure.Persistence.ApplicationDbContext'.' was thrown while attempting to create an instance. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728
My Apphost has a reference to the Infrastrucure project as an non-Aspire resource
I am running the ef command from the solution root folder
Any help is greatly appreciated
John Oriente
Beta Was this translation helpful? Give feedback.
All reactions