答案1
我从不使用 appcmd.exe,但你可以这样做:
appcmd.exe set config -section:system.applicationHost/applicationPools /[name='DefaultAppPool'].enable32BitAppOnWin64:"True" /[name='DefaultAppPool'].managedPipelineMode:"Integrated" /[name='DefaultAppPool'].startMode:"AlwaysRunning" /commit:apphost
appcmd.exe set config -section:system.applicationHost/applicationPools /[name='DefaultAppPool'].processModel.identityType:"LocalSystem" /commit:apphost
在 PowerShell 中使用 WebAdministration 模块:
Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -filter "system.applicationHost/applicationPools/add[@name='DefaultAppPool']" -name "enable32BitAppOnWin64" -value "True"
Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -filter "system.applicationHost/applicationPools/add[@name='DefaultAppPool']" -name "managedPipelineMode" -value "Integrated"
Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -filter "system.applicationHost/applicationPools/add[@name='DefaultAppPool']" -name "startMode" -value "AlwaysRunning"
Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -filter "system.applicationHost/applicationPools/add[@name='DefaultAppPool']/processModel" -name "identityType" -value "LocalSystem"
在这两种情况下,您都需要DefaultAppPool
用真实姓名替换该姓名。
我希望您有充分的理由将您的池作为系统运行,我永远不会这样做。