<EnvironmentName>
to your publish profile and be done with it:<PropertyGroup>
<EnvironmentName>Development</EnvironmentName>
</PropertyGroup>
That information gets copied to web.config. (Don't set web.config manually since it gets overwritten.)
Source: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/environments