Difference between revisions of "AppCmd command to change Environment Variable"

From Logic Wiki
Jump to: navigation, search
Line 5: Line 5:
 
in TFS just write  
 
in TFS just write  
 
  set config "<SITENAME>" -section:system.webServer/aspNetCore /+"environmentVariables.[name='ASPNETCORE_ENVIRONMENT',value='<VARIABLEVALUE>']" /commit:site
 
  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

Revision as of 10:57, 19 November 2018


%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