public static async Task StopAndWait(this IIS.ApplicationPool appPool) { appPool.Stop(); await appPool.WaitForState(IIS.ObjectState.Stopped); }
public static void StopAndWait(this IIS.ApplicationPool appPool) { var wait = new PollingWait(() => appPool.Stop(), () => appPool.State == IIS.ObjectState.Stopped); wait.Invoke(); }