Open thompcd opened 3 years ago
From a quick search I came across someone who had the same issue because the startup project was not correct. As mentioned in the https://codewithmukesh.com/blog/blazor-hero-quick-start-guide/ the startup project should be the api (web/server/server.cproj) project and not Infrastructure.csproj unless you mean it is the default project in the package manager.
When I attempt to setup my database for the first time I am getting errors which I am not certain whether they are due to code issues or configuration.
I've followed the readme and blog post (https://codewithmukesh.com/blog/blazor-hero-quick-start-guide/) to get started on both Mac and Windows and I receive the same results in both OS.
I've looked onto stack overflow and saw a suggestion to add empty constructors on the contexts to test if the context injection was the issue which produced no results when adding empty constructors to both AuditableContext and BlazorHeroContext.
I've also tried injecting the contexts during ConfigureServices and still receive the same error.
Following the MS error link from the console output takes me to a dead page with a notification that what I'm looking for has moved.
Additionally, I have tried cloning the source code directly and receive the same issue.
To Reproduce cd ../src/Infrastructure Set startup project --> Infrastructure.csproj update-database OR cd ../src/Infrastructure dotnet ef -v --startup-project ./Infrastructure.csproj migrations add Migration001
output:
Expected behavior Once the database migration is done, you will be able to see the newly created database in the server explorer. Default Data like Roles and Users will be seeded into the database when you run the application for the first time.
Desktop (please complete the following information):
Additional context Fresh install of VS2019 for Mac on my Mac, pulled latest template of BlazorHero as of 10/22/21 (uncertain how to see version)