Migration bundle only executes code in `Development` mode
Using EF Core 7.0 with ASP.NET Core 7.0, running
dotnet ef migrations bundle --configuration Release
actually executes application code (specifically Program.cs until app.Build(), to build the DI container to then get an instance of DbContext) with builder.Environment.Name of Development, even though --configuration has been set to Release. This means that for example the right appsettings*.json file won't be read.
In fact, --configuration Release doesn't seem to have any effect whatsoever in the case of the ef migrations bundle command, am I missing something?
/cc @bricelam
I think you're trying to set the ASP.NET environment, not the build configuration:
dotnet ef migrations bundle -- --environment Production
@bricelam Hi.
I can not understand what I'm doing wrong, everything seems to be done according to the instruction.

[Updates] Checked it now, it really works. thnx @bricelam
We should consider #8695 when fixing this.
Note, it might actually be using the Production environment. That message just means that it's setting ASPNETCORE_ENVIRONMENT to compensate for the lack of #8695.