We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

Using Appcmd to set preloadEnabled=true [Answered]RSS

2 replies

Last post Feb 27, 2013 08:08 PM by AlexLaverty

  • Using Appcmd to set preloadEnabled=true

    Feb 27, 2013 01:35 AM|AlexLaverty|LINK

    Hi Guys,

    I need to set the following options in applicationhost.config for a given virtual application on a Windows 2008 R2 server,

    AlwaysRunning = True

    AutoStart = True

    preloadEnabled = True

    I am handling the first two settings with the command :

    C:\windows\system32\inetsrv\APPCMD.exe set apppool testappPool /autoStart:true /startMode:AlwaysRunning

    the last option I am having troubles setting, I believe I could get it set using appcmd set config, the closest I have got so far is :

    .\appcmd.exe set config "testwebsite/testvdir" -section:system.applicationHost/sites /+"[preloadEnabled ='true']" /commit:apphost

    but it throws the error:

    ERROR ( message:Unknown attribute " preloadEnabled ". )

    any help would be greatly appreciated.

    Regards Alex

  • Re: Using Appcmd to set preloadEnabled=true

    Feb 27, 2013 08:12 AM|terridonahue|LINK

    Hi Alex,


    Have you installed the ApplicationInitialization module? preloadEnabled requires that module to be installed.

    Terri Donahue
    Microsoft MVP ASPNET/IIS

    Please 'Mark as Answer' if this post helps you.
  • Re: Using Appcmd to set preloadEnabled=true

    Feb 27, 2013 08:08 PM|AlexLaverty|LINK

    Ah ok, I was not aware of this component, thank you I have installed it on the server and rebooted, for any one else wanting to set preloadEnabled through appcmd the command is :

    appcmd set app "websitename/vdirname" /preloadEnabled:true