"the entries cannot be reordered because one or more of them have been locked in the parent file "
in iis 7.0 manager when i try to change the order of modules in my application it gives this message.
how can i change the order of the modules ? is it possible?
Can't you do it on Server level instead of site level?
To change the order of modules for a site you first need to unlock the affected modules on the server level. Because you don't really know which modules are affected, I usually unlock them all. The easiest way to do this is with a PowerShell script (if you are still on IIS7, you need to download the PowerShell IIS snapin).
Save the following into text file: unlock-modules.ps1
Import-Module WebAdministration
Get-WebConfiguration `
-pspath 'MACHINE/WEBROOT/APPHOST' `
-filter "system.webServer/modules/add" -recurse | `
where {$_.PSPath -eq 'MACHINE/WEBROOT/APPHOST' -and $_.Type -eq ''} `
| foreach {
$filter = "system.webServer/modules/add[@name='" + $_.Name + "']"
Remove-WebConfigurationLock -pspath 'MACHINE/WEBROOT/APPHOST' -filter $filter -verbose
}
Open a PowerShell prompt as elevated administrator and run the script.
The script loops through all the modules at server level. Usually only the native modules (with and empty 'type' property) are locked. Unlock them all.
Now you can make changes to the order of the module at site level.
Be careful when the re-ordering, if you change the order of some of the system modules, IIS may no longer work in the expected way.
Also remember, that if you make changes to the modules at server level, the site will no longer inherit these and you have to apply them to the site level as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With