I use ASP.NET Core 1.1.
When I publish my application the IHostingEnvironment always return the environment as "Production".
I made some attempts via the web.config as follows:
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
</handlers>
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false">
<environmentVariables>
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
</environmentVariables>
</aspNetCore>
</system.webServer>
Unfortunately it doesn't has any effect.
I also get a warning about that the aspNetCore is invalid child of system.webServer...
I have seen at the project.json the scripts entry that runs dotnet publish-iis command but couldn't find any environment parameter.
I have tried to pass the publish command --iis-command (As described in this post) but it doesn't identify this parameter.
I will highly appreciate your thoughts about it...