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

Closed Issue: Iis7AppPool Start throws COMException [11577]

$
0
0
I was getting a COMException: _The object identifier does not represent a valid object_ from the Start action of the Iis7AppPool task. Google suggests this might be to do with the Windows Process Activation Service not being ready. I've forked the source and added the following method to catch the exception, wait 100ms and retry up to 3 times:

private void StartAppPoolWithRetry(int retryCount)
{
try
{
this.pool.Start();
}
catch (COMException e)
{
if (e.Message.Contains("The object identifier does not represent a valid object")
&& retryCount < 3)
{
retryCount++;
LogTaskMessage(string.Format(CultureInfo.InvariantCulture, "..Sleeping and retrying {0}", retryCount));
Thread.Sleep(100);
StartAppPoolWithRetry(retryCount);
}
else
throw;
}
}

Then I'm calling StartAppPoolWithRetry(0) instead of this.pool.Start().
Comments: Resolved with changeset 82662: IIS7\IIS7AppPool.cs: Implement StartAppPoolWithRetry logic (3.5 codebase)

Viewing all articles
Browse latest Browse all 1211

Latest Images

Trending Articles



Latest Images

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