Search code examples
.netwcfiispreloadiis-8.5

Change IIS PreloadEnable to True Globally


I have a vendor application that will uninstall and reinstall an application in IIS. Each time, I will need to reinstate the preload settings through the command below after installation has completed:

appcmd set app "<site>/<sub_site>" /preloadEnabled:true

This is because the default value for preloadEnabled is "false". However, I am looking at a way to change the default values for "preloadEnabled" to true so that I do not need to always execute the above command. Could anyone advice me how I could do so?

I am using IIS 8.5


Solution

  • I managed to find a solution to this. I could modify the default value via Configuration Editor under the system.applicationHost/sites path.

    Sample command:

    appcmd set config -section:system.applicationHost/sites "/[name='<Site>'].applicationDefaults.preloadEnabled:True" /commit:apphost
    

    Replace <site> accordingly.