Last active
February 22, 2024 09:07
-
-
Save Digiover/c2ade0f1c9cbedba02235ab65f70ed16 to your computer and use it in GitHub Desktop.
Add Aspnet.config HighDensityWebHosting performanceScenario
This file contains hidden or 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
# https://www.saotn.org/aspnet-performance-what-to-keep-in-mind/#highdensitywebhosting | |
$bitness = @("64", "") | |
foreach ($bits in $bitness) { | |
$xml = New-Object xml | |
$xml.Load("C:\Windows\Microsoft.NET\Framework${bits}\v4.0.30319\Aspnet.config") | |
# Check whether HighDensityWebHosting performanceScenario is already registered | |
$nodePerformanceScenario = $xml.SelectSingleNode("configuration/performanceScenario") | |
# Not registered, let's add HighDensityWebHosting performanceScenario to Aspnet.config | |
if ($nodePerformanceScenario -eq $null) { | |
$parentNode = $xml.SelectSingleNode("configuration") | |
$childNode = $xml.CreateElement("performanceScenario") | |
$childNode.SetAttribute("value", "HighDensityWebHosting") | |
$parentNode.AppendChild($childNode) | |
} | |
$xml.Save("C:\Windows\Microsoft.NET\Framework${bits}\v4.0.30319\Aspnet.config") | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Don't forget to reset IIS afterwards