protected override void DoExecute() { if (!_iisManager.AppPoolExists(_machineName, _appPoolInfo.Name)) { throw new InvalidOperationException(string.Format("Application pool named '{0}' doesn't exist on '{1}'.", _appPoolInfo.Name, _machineName)); } // TODO IMM HI: we could verify here that the existing app pool has the same version and mode as the one needed by the web app _iisManager.SetAppPool(_machineName, FullWebAppName, _appPoolInfo.Name); }