AppCmd command to change Environment Variable

From Logic Wiki
Revision as of 10:57, 19 November 2018 by AliIybar (Talk | contribs)

Jump to: navigation, search


%systemroot%\system32\inetsrv\appcmd.exe set config "<SITENAME>" -section:system.webServer/aspNetCore /+"environmentVariables.[name='ASPNETCORE_ENVIRONMENT',value='<VARIABLEVALUE>']" /commit:site

in TFS just write

set config "<SITENAME>" -section:system.webServer/aspNetCore /+"environmentVariables.[name='ASPNETCORE_ENVIRONMENT',value='<VARIABLEVALUE>']" /commit:site


The commit parameter can be set to one of the following:

  • (omitted) — default; write configuration at the level for which it is set
  • url — same as default; write configuration at the level for which it is set
  • site — write configuration in the Web.config at the site root of the url for which it is set
  • app — write configuration in the Web.config at the app root of the url for which it is set
  • apphost — write configuration at the server level, in the applicationHost.config file
  • <PATH> — write configuration at the specified config path