"The Template Persistent Cache initialization failed for Application Pool" on IIS 7 using Classic ASP


When restarting IIS the following error may appear in the event log:

Log Name: Application
Source: Active Server Pages
Event ID: 5
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Description: Error: The Template Persistent Cache initialization failed for Application Pool 'DefaultAppPool' because of the following error: Could not create a Disk Cache Sub-directory for the Application Pool. The data may have additional error codes..


Check the path for ASP cache:

%windir%\system32\inetsrv\appcmd list config -section:system.webServer/asp

    <session />
    <comPlus />
    <cache diskTemplateCacheDirectory="%SystemDrive%\inetpub\temp\ASP Compiled Templates" />
    <limits />

Ensure the path exists (from above):

mkdir "%SystemDrive%\inetpub\temp\ASP Compiled Templates"

A subdirectory or file C:\inetpub\temp\ASP Compiled Templates already exists.

Ensure the permissions include NETWORK SERVICE:

icacls "%SystemDrive%\inetpub\temp\ASP Compiled Templates" /grant "NETWORK SERVICE:(OI)(CI)(M)"

processed file: C:\inetpub\temp\ASP Compiled Templates
Successfully processed 1 files; Failed processing 0 files

This can be caused by using the MOVEIIS7ROOT.CMD script, and then adding components at a later date.


IIS7: Moving the INETPUB directory to a different drive

DCPROMO does not retain permissions on some IIS folders

You receive a "Service Unavailable" error message when you browse an IIS 6.0 Web page on a Windows Server 2003-based domain controller


Microsoft Windows Server 2008 (any)
Microsoft Internet Information Services 7.0

Created: 14th July 2009
Updated: 17th July 2009

© 2005-2018 Jamie Morrison