How am I able to set the sites web.config "ASPNETCORE_ENVIRONMENT" environmentVariable with APPCMD.exe?
So far I've tried ending it using /commit:MACHINE/WEBROOT
, /commit:webroot
and I get the below:
appcmd.exe set config "Default Web Site/Help" -section:system.webServer/aspNetCore /+"environmentVariables.[name='ASPNETCORE_ENVIRONMENT',value='Standalone']" /commit:MACHINE/WEBROOT
ERROR ( message:Configuration error
Filename: \\?\C:\inetpub\wwwroot\Help\web.config
Line Number: 0
Description: The configuration section 'system.webServer/aspNetCore' cannot be read because it is missing a section declaration
. )
However I can update the "applicationHost.config" using the same code as below but a different /commit
. I don't want to update the "APPHOST" though as I need to do the "web.config", which is where the value already is that I need to update:
set config "Default Web Site/Help" -section:system.webServer/aspNetCore /+"environmentVariables.[name='ASPNETCORE_ENVIRONMENT',value='Standalone']" /commit:apphost
Applied configuration changes to section "system.webServer/aspNetCore" for "MACHINE/WEBROOT/APPHOST/Default Web Site/Help" at configuration commit path "MACHINE/WEBROOT/APPHOST"