Quantcast
Channel: MSBuild Extension Pack
Viewing all articles
Browse latest Browse all 1211

New Post: Iis7AppPool Start throws COMException

$
0
0
Yes I've heard of this.

Thanks for the fix. What do you think of the following. I've increased the sleep to 1 second and removed the contains check as this won't work on non-english systems. I'm also logging a low importance message
    private void StartAppPoolWithRetry(int retryCount)
    {
        try
        {
            this.pool.Start();
        }
        catch (COMException e)
        {
            if (retryCount < 3)
            {
                retryCount++;
                this.LogTaskMessage(MessageImportance.Low, e.Message);
                this.LogTaskMessage(string.Format(CultureInfo.InvariantCulture, "..Sleeping and retrying {0}", retryCount));
                Thread.Sleep(1000);
                this.StartAppPoolWithRetry(retryCount);
            }
            else
            {
                throw;
            }
        }
    }
if you are happy with that I will commit.

Viewing all articles
Browse latest Browse all 1211

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>