Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added .net root web.config to buildpack
Change-Id: I32d6db8b4810e27bc699b800c70b8b7488da524f
- Loading branch information
1 parent
46321b7
commit bf6d65f
Showing
12 changed files
with
1,606 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
$script:scriptPath = split-path -parent $MyInvocation.MyCommand.Definition | ||
$script:appPath = (get-item $script:scriptPath).parent.FullName | ||
|
||
$applicationHostPath = Join-Path $script:scriptPath 'applicationHost.config' | ||
$webConfig = New-Object System.Xml.XmlDocument | ||
$webConfig.Load($applicationHostPath) | ||
$val = $webConfig.SelectSingleNode("/configuration/system.applicationHost/applicationPools/add").Attributes["enable32BitAppOnWin64"].Value.ToString() | ||
$enabled32bit = [System.Convert]::ToBoolean($val) | ||
|
||
if ($enabled32bit) | ||
{ | ||
$bitness = "86" | ||
} | ||
else | ||
{ | ||
$bitness = "64" | ||
} | ||
|
||
$webConfigPath = Join-Path $script:appPath 'web.config' | ||
$webConfig = New-Object System.Xml.XmlDocument | ||
$webConfig.Load($webConfigPath) | ||
|
||
$node = $webConfig.SelectSingleNode("/configuration/system.web/compilation/@targetFramework") | ||
if ($node) | ||
{ | ||
Write-Host("Application requires asp.net v4.0"); | ||
$version = 40 | ||
} | ||
else | ||
{ | ||
Write-Host("Application requires asp.net v2.0"); | ||
$version = 20 | ||
} | ||
|
||
$rootWebConfigFileName = "rootWeb" + $version + $bitness + ".config" | ||
$rootWebConfigPath = Join-Path $script:scriptPath $rootWebConfigFileName | ||
|
||
$rootWebConfig = New-Object System.Xml.XmlDocument | ||
$rootWebConfig.Load($rootWebConfigPath) | ||
$tmpPath = Join-Path $env:HOME "tmp" | ||
$compilationPath = Join-Path $tmpPath "aspnet_compilation" | ||
|
||
$element = $rootWebConfig.SelectSingleNode("configuration/system.web/compilation") | ||
$element.SetAttribute('tempDirectory', $compilationPath) | ||
|
||
$rootWebConfig.Save($rootWebConfigPath) | ||
|
||
$host.SetShouldExit($version) | ||
exit |
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
@echo off | ||
powershell -ExecutionPolicy bypass "& %~dp0\start.ps1" | ||
IF %ERRORLEVEL% EQU 0 (%~dp0\iishwcx64.exe %~dp0applicationHost.config) ELSE (%~dp0\iishwcx86.exe %~dp0applicationHost.config) | ||
set bitness=%ERRORLEVEL% | ||
powershell -ExecutionPolicy bypass "& %~dp0\detectVersion.ps1" | ||
set version=%ERRORLEVEL% | ||
IF %bitness% EQU 0 ( | ||
IF %version% EQU 40 ( | ||
%~dp0\iishwcx64.exe %~dp0applicationHost.config %~dp0rootWeb4064.config %PORT% | ||
) ELSE ( | ||
%~dp0\iishwcx64.exe %~dp0applicationHost.config %~dp0rootWeb2064.config %PORT% | ||
) | ||
) ELSE ( | ||
IF %version% EQU 40 ( | ||
%~dp0\iishwcx86.exe %~dp0applicationHost.config %~dp0rootWeb4086.config %PORT% | ||
) ELSE ( | ||
%~dp0\iishwcx86.exe %~dp0applicationHost.config %~dp0rootWeb2086.config %PORT% | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters