Hi All,
I have a webservice on one of my websites which restarts the websites app pool.
The problem Im getting is the IIS7 app pool keeps stopping with the following warning and then error:
Warning: A process serving application pool 'appPoolNameHere' exceeded time limits during shut down.
Error: Application pool 'appPoolNameHere' is being automatically disabled due to a series of failures in the process(es) serving that application pool.
The code I am using to do this is:
try
{
var serverManager = new ServerManager();
var currentPoolName = SettingsManager.AppPoolName;
if (!string.IsNullOrEmpty(currentPoolName))
serverManager.ApplicationPools[currentPoolName].Recycle();
HttpRuntime.Close();
}
catch (Exception ex)
{
var exceptionManager = ExceptionManagerFactory.GetExceptionManager();
exceptionManager.LogException(ExceptionManager.Severities.Critical, ex,
"App Pool restart failed");
}
I am not getting any exceptions being thrown here, but the app pool is stopping, this doesnt happen all the time and is very hard to replicate, I have tried several different things even just hitting the hell out of that service and sometimes its fine other times it dies.
Is there anything I can do to fix this?
The reason I have to restart it is due to an external config file to the webconfig which deals with the url redirects which is updated from the admin system.
Thanks for any help with this.