Skip to content
This repository was archived by the owner on Feb 15, 2023. It is now read-only.

Updating web.config transform to handle 'location' & 'environmentvariables' #377

Merged
merged 2 commits into from
Jul 5, 2018

Conversation

vijayrkn
Copy link
Contributor

@vijayrkn vijayrkn commented Jul 4, 2018

if web.config is not present in the project & msbuild property $(EnvironmentName) with value 'Staging' is passed, then the following web.config will be generated.

  • Location is added for newly generated web.configs
  • Location is not added if a web.config is passed without the location.
  • Environment name will be overwritten if $(EnvironmentName) is passed and existing web.config already has one.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath="dotnet" arguments=".\WebApplication242.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout">
        <environmentVariables>
          <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Staging" />
        </environmentVariables>
      </aspNetCore>
    </system.webServer>
  </location>
</configuration>

@mlorbetske @shirhatti @pan-wang

@vijayrkn
Copy link
Contributor Author

vijayrkn commented Jul 4, 2018

Partial fix for : dotnet/aspnetcore#2019

@vijayrkn
Copy link
Contributor Author

vijayrkn commented Jul 5, 2018

Ping!

@natemcmaster natemcmaster reopened this Jul 5, 2018
@natemcmaster
Copy link
Contributor

Attempting to trigger PR checks.

@natemcmaster
Copy link
Contributor

LGTM.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants