In order to set a Environment variable for the IIS hosted app via web.config we need to add <EnvironmentVariables>
element inside the <aspNetCore>
element.
<environmentVariables>
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
</environmentVariables>
Example of your config should look like this:
<aspNetCore processPath="dotnet" arguments=".\YourApp.dll"
stdoutLogEnabled="false"
stdoutLogFile=".\logs\stdout"
hostingModel="inprocess">
<environmentVariables>
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
</environmentVariables>
</aspNetCore>
Top comments (0)