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

Issue

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..

Resolution

Check the path for ASP cache:

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

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


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.

References

IIS7: Moving the INETPUB directory to a different drive
http://blogs.iis.net/thomad/archive/2008/02/10/moving-the-iis7-inetpub-directory-to-a-different-drive.aspx

DCPROMO does not retain permissions on some IIS folders
http://support.microsoft.com/kb/332097

You receive a "Service Unavailable" error message when you browse an IIS 6.0 Web page on a Windows Server 2003-based domain controller
http://support.microsoft.com/kb/842493

Products

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

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


© 2005-2017 Jamie Morrison