When running ASP.NET Core apps, the WebHostBuilder will automatically attempt to determine which environment it is running in. By convention, this will be one of Development, Staging or Production, but you can set it to any string value you like.

This link will give you much information, but if you use IIS as proxy of ASP.NET CORE, you need to set the environment in web.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath="dotnet" arguments=".\Host.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false">
      <environmentVariables>
        <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
      </environmentVariables>
    </aspNetCore>
  </system.webServer>
</configuration>

IOW, you need to add the following content to web.config

<environmentVariables>
        <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
      </environmentVariables>
ABOUT

We are programmers, lives in Hangzhou, Zhejiang, China. The difference with other programmers is We are software architects (or want to be), particularly love . NET Core, but we also embrace all the new stuff. (^<>^)

A man like we, are unique in the world of existence, no matter where you go, there belonging to our stage. Like desert gold, light can not hide forever! Especially our messy hair, melancholy eyes, sigh of stubble, handsome face, are deeply addicted whom even we.

PEOPLE