This project is read-only.

IIS 7.5 application pools startMode="AlwaysRunning" ?

Nov 24, 2011 at 7:39 AM

Hello all,

The end game is that I need to set startMode="AlwaysRunning" in ApplicationHost.config:


           <add name="myAppPool" autoStart="true" startMode="AlwaysRunning">


Have dug through the source code of and it appears that the Application pool class in the web administration dll lacks this property?


[assembly: AssemblyVersion("")]

[assembly: AssemblyInformationalVersion("6.1.7600.16385")]

    public sealed class ApplicationPool : ConfigurationElement
        public bool AutoStart { getset; }
        public ApplicationPoolCpu Cpu { get; }
        public bool Enable32BitAppOnWin64 { getset; }
        public ApplicationPoolFailure Failure { get; }
        public ManagedPipelineMode ManagedPipelineMode { getset; }
        public string ManagedRuntimeVersion { getset; }
        public string Name { getset; }
        public ApplicationPoolProcessModel ProcessModel { get; }
        public long QueueLength { getset; }
        public ApplicationPoolRecycling Recycling { get; }
        public ObjectState State { get; }
        public WorkerProcessCollection WorkerProcesses { get; }
        public ObjectState Recycle();
        public ObjectState Start();
        public ObjectState Stop();

Does any know how I can set startMode="AlwaysRunning" I tried to find a newer version of Microsoft.Web.Administration.dll but all my servers seem to have this version?

I'm happy to submit a patch once I figure it out.

Kind regards,

Andrew Stone.

Nov 25, 2011 at 5:52 AM

I Noticed that this setting can be changed with appcmd on 2008 R2:

%windir%\system32\inetsrv\appcmd.exe set apppool "theAppPool" /startMode:AlwaysRunning

So for now I will do this in an <Exec ...

Anyone know how to implement more neatly into: MSBuild.ExtensionPack.Web.Iis7AppPool ?

I’m happy to do the work if anyone can provide a quick pointer on what would constitute an acceptable technique? (calling appcmd from a task seems like a bit of a hack)

Nov 25, 2011 at 5:13 PM

This is an iis7.5 only feature. There isn't anything in the extension pack to handle it at the moment.... will add it... Mike

Nov 25, 2011 at 5:14 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Nov 26, 2011 at 2:28 AM

Thanks Mike.