Search code examples
asp.netwebrequestpool

application pool stopped on webrequest


I have a site that has been working fine for months. This morning I started getting 503 Service Unavailable errors. After checking IIS, I noticed that the application pool is being stopped. Since I had issues with it before, I suspected WebRequest to be the problem. So I commented out the WebRequest portion of the site, and guess what, the application pool no longer gets disabled. I suspect there has been another security update and I can't figure out what else I need to do to get the WebRequest to work again.

Things I have already tried:
1) aspnet_regiis -u then -i
2) reinstalling .net framework

More info: I use NetworkService account for the asp.net v4.0 app pool with Windows Authentication

The error from the event log is this:
"HipIISEngineStub.dll failed to load. The data is the error."

var request = (HttpWebRequest)WebRequest.Create(path1);
request.Credentials = CredentialCache.DefaultCredentials;
request.PreAuthenticate = true;            

var getResponse = new Func<WebRequest, WebResponse>(req => req.GetResponse());

try
{
    return getResponse(request).GetResponseStream();
}

Solution

  • This is related to McAfee Host Intrusion Prevention. Can it be that your McAfee license has run out? Or that you have an old version that needs to be updated? Look over your McAfee installation. Maybe reinstall it.

    If you have uninstalled McAfee recently, or changed the installation somehow, there is probably still a reference to it in your ISAPI settings. Try to remove the reference to the MfeEngine in your applicationHost.config:

    https://kc.mcafee.com/corporate/index?page=content&id=KB72677&actp=LIST

    Quote from the page (my emphasis):

    • Start Notepad as Administrator!
    • Navigate to: %windir%\system32\inetsrv\config
    • Open the file applicationHost.config for editing in Notepad.
    • Edit the globalModules section and remove the following line:
    <add name="MfeEngine" image="%windir%\System32\inetsrv\HipIISEngineStub.dll" />
    
    • Edit the modules section and remove the following line:
    <add name="MfeEngine" />
    
    • After you have finished editing the applicationHost.config file, save the file, then restart the IIS server using iisreset or by restarting the system.