Currently - as ModulesHost is a generic host - the environment will be loaded from a DOTNET_ENVIRONMENT variable.
However - it is very common that instead only ASPNETCORE_ENVIRONMENT is used.
See also: https://docs.microsoft.com/de-de/aspnet/core/fundamentals/environments?view=aspnetcore-5.0
Maybe we should also override DOTNET_ENVIRONMENT with ASPNETCORE_ENVIRONMENT for ModulesHost
AB#606