I've created a new project using .NET 6 and EF Core 6 but when I try to create a migration using dotnet ef migrations add, the CLI begins running the application after "Build succeeded.".
This isn't preventing the migrations from being created but adds a considerable amount of time to the process as I need to wait for the application to exit before issuing any other commands.
Snippet of dotnet ef migrations add output:
Within the same solution I have many other projects using .NET 5 and EF Core 5 which all create migrations as expected (just builds the project, doesn't run it).
Is this new functionality for EF Core 6 or is there a configuration somewhere which would cause this behaviour?
EDIT
It seems like the issue is EF Core ignoring implimentations of IDesignTimeDbContext factory during migration creation and instead defaults to obtaining an instance of the DbContext from the host builder. Apparently can also happen with EF Core 5.
There is an open issue on the dotnet/efcore github here: Migrations script not using IDesignTimeDbContextFactory
