아무도 powershell을 사용하여 IIS에서 asp.net 4.0 워밍업 메커니즘을 사용하는 방법을 알려주시겠습니까?asp.net 4.0에 대한 IIS 워밍업을 powershell 스크립트로 작성하는 방법은 무엇입니까?
나는이 PowerShell 스크립트를 만들었습니다,하지만 ApplicationHost.config 파일에 아무것도 기록하지 않는 것 : 이 (여기에서 3 단계를 구현하기 위해 노력을하지만, 파워 쉘 사용 : http://weblogs.asp.net/gunnarpeipman/archive/2010/01/31/asp-net-4-0-how-to-use-application-warm-up-class.aspx를)
Import-Module WebAdministration
$SiteName="Default Web Site"
$ApplicationName=“WebOne“
Add-WebConfiguration "system.applicationHost/sites/site[@name='Default Web Site']/application[@path='WebOne']" -Value @{serviceAutoStartEnabled="true";serviceAutoStartProvider="PreWarmMyCache"} -PSPath IIS:\Sites\$SiteName\$ApplicationName -Location $SiteName/$ApplicationName
나는이 2 개의 속성을 추가하기 위해 노력하고있어 (serviceAutoStartEnabled="true" and serviceAutoStartProvider="PreWarmMyCache"):
예 : 내 현재 출원으로
<application path="/" serviceAutoStartEnabled="true" serviceAutoStartProvider="PreWarmMyCache" />:
가스화 경로 : (파워 쉘 여기에서 4 단계 만 사용 : http://weblogs.asp.net/gunnarpeipman/archive/2010/01/31/asp-net-4-0-how-to-use-application-warm-up-class.aspx를) :
<sites>
<site name="Default Web Site" id="1">
<application path="/WebOne" applicationPool="ASP.NET v4.0">
<virtualDirectory path="/" physicalPath="C:\NetProjects\WebOne" />
</application>
</site>
</sites>
내가이 파워 쉘 스크립트가 필요합니다
<serviceAutoStartProviders>
<add name="PreWarmMyCache" type="PreWarmCache, MyAssembly" />
</serviceAutoStartProviders>
어떤 도움이 될 것 크게
을 appriciated.-필자는 이미 powershell을 사용하여 아래의 내용을 스크립팅했지만 위의 내용 (serviceAutoStartEnabled = "true"및 serviceAutoStartProvider = "PreWarmMyCache")이 필요합니다.
#Load IIS Modules
Import-Module WebAdministration
if (Test-Path IIS:\AppPools\SosSWarmUpWorkerProcess)
{
#Let's delete the entry if it's already there (while deploying between versions)
Remove-Item IIS:\AppPools\SosSWarmUpWorkerProcess -Force -Recurse
}
$myNewPool = New-Item IIS:\AppPools\SosSWarmUpWorkerProcess
$myNewPool.managedRuntimeVersion = "4.0"
$myNewPool.startMode="AlwaysRunning"
$myNewPool | Set-Item