Migrating to Core 2.2 ASPNETCORE_ENVIRONMENT not set

As it is a common practice in .NET Core apps, I've used a fair amount of <environment names="Development">. After an upgrade of one of my web apps from .NET Core 2.1 to 2.2 the application's environment names did not match anymore - resulting in missing css-files on the htmlpage.

After some research it seemed to be caused because this particular solution (which was quite an old project) had a web.config file with a declaration of ASPNETCORE_ENVIRONMENT in there as well.

According to this issue aspnet core gitissue 6140 it appends the value. Now I assume this causes the error. If I remove the web.config's defition of the variable it worked as before.

I haven't tried, but instead of using <environment names="Development"> you could try <environment include="Development"> the include/exclude possibility was added in .NET Core 2.