最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

EF Core migrations with Aspire - Stack Overflow

programmeradmin3浏览0评论

I have project structure like this:

EFPlayground
- EFPlayground (API project)
- EFPlayground.AppHost (Aspire app host project)

My DbContext is located in the EFPlayground project.

Running the project is ok, but adding new a migration/removing existing migration won't work with commands:

dotnet ef migrations add InitialCreate --project EFPlayground 
       --startup-project EFPlayground.AppHost


dotnet ef migrations remove --project EFPlayground 
       --startup-project EFPlayground.AppHost

I get this error:

C:\Users\y\source\repos\EFPlayground\EFPlayground.AppHost\bin\Debug\net9.0\EFPlayground.dll' not found.

EFPlayground.AppHost has a reference to the EFPlayground API project.

Also, I'm running dotnet build every time before I am executing dotnet ef migrations. Also because I am using VS I tried to build the solution with VS and terminal.

Am I missing something? I was unable to find any good documentation for working with .NET Aspire, EF Core and migrations. It would be good if someone have good documentation for this.

发布评论

评论列表(0)

  1. 暂无评论