IT Nota

  • Home
  • How To
  • .NET
  • WordPress
  • Contact

How to Fix Could Not Create a Disk Cache Sub-Directory for the Application Pool on IIS

During one of the upgrade projects from Windows Server 2003 to Windows Server 2008 32-bit, the following error occurs:

Source : Active Server Pages

Error: The Template Persistent Cache initialization failed for Application Pool 'AppPoolName' because of the following error: Could not create a Disk Cache Sub-directory for the Application Pool. The data may have additional error codes..

This happened soon after the Windows Server 2003 was in-place upgraded to Windows Server 2008.

One the problems here is after the upgrade, the default ASP Compiled Templates folder got moved but the application config is still pointing to the old path. The second issue is typically the new folder does not have permissions setup properly.

As a background information, the Application Pool for this classic ASP application is run under .NET Framework v2.0 with Managed Pipeline Mode Classic and Identity set to NetworkService.

So here are the steps to fix the issue.

Give Permissions to ASP Compiled Templates Folder

  1. Open Windows Explorer and go to %SystemDrive%\inetpub\temp and you should see a folder called ASP Compiled Templates.

  2. Right-click on the folder and select Properties and click on the Security tab.

    ASP Compiled Templates folder Properties

  3. If this is the first time you access it, you may see the prompt as shown below. Just click the Continue button and you’ll see the Advanced Security Settings for ASP Compiled Templates screen.

    ASP Compiled Templates Security Tab

  4. On the Change owner to: box, select either your group or your NTID and check Replace owner on subcontainers and objects and click OK and Yes when prompted by Windows Security box (All permissions will be replaced if you press Yes).
  5. As instructed, you should close all dialog boxes and go back to the folder’s Properties and click on the Security tab again. This time, you should be able to add a user.
  6. Click on the Add… button and type in Network Service and click OK.
  7. Highlight NETWORK SERVICE and check Full control on the Permissions for NETWORK SERVICE box.

    Set full permission for NETWORK SERVICE for ASP Compiled Templates

  8. Click OK two times to close all dialog boxes

Now we have set the permission, we also need to modify the value of the new path in applicationHost.config file.

Fix Application Config File

  1. Open Windows Explorer and go to %Windir%\System32\inetsrv\config and look for a file applicationHost.config.
  2. Backup applicationHost.config file.
  3. Open applicationHost.config either using a Notepad or any text editor.
  4. Search for “ASP Compiled Templates” and you should find the diskTEmplateCacheDirectory value for the old path.

    Modify path for ASP Compiled Templates in applicationHost.config file

  5. Change the old path to the new one. In this example, the new path is %SystemDrive%\inetpub\temp\ASP Compiled Templates.

    <cache diskTemplateCacheDirectory="%SystemDrive%\inetpub\temp\ASP Compiled Templates" maxDiskTemplateCacheFiles="2000" scriptFileCacheSize="250" scriptEngineCacheMax="125" enableTypelibCache="true" />
    
  6. Save the change and close Notepad.

Along with this error, another error HostableWebCore (Event ID 5053) also occurred, but that was easily fixed by following the steps from this Microsoft Technet article.

Further Reading

Template Persistent Cache Error with Classic ASP under IIS 7
“The Template Persistent Cache initialization failed for Application Pool” on IIS 7 using Classic ASP Issue
Can I delete “C:\inetpub\temp\ASP Compiled Templates” folder?
Event ID 5053 — IIS WAS Configuration

July 23, 2015 Filed Under: How To Tagged With: Classic ASP, IIS, Internet Information Services, Microsoft, Windows Server

Buy me a coffee?

Buy me a coffee If you find any of the articles or demos helpful, please consider supporting my work here, you'll have my big thanks!

Buy me a coffee Support this site
Buy Me a Coffee?

Categories

  • .NET
  • Coding
  • Cybersecurity
  • Database
  • How To
  • Internet
  • Multimedia
  • Photography
  • Programming
  • Resources
  • Review
  • Tips and Tricks
  • Uncategorized
  • Use Case
  • WordPress
  • Writing

Recent Posts

  • How to View Stored Procedure Code in SQL Server
  • How to Find a String in SQL Server Stored Procedures
  • How to Remove Cached Credentials without Rebooting Windows
  • ESP Work Automation: Empowering Enterprises with Streamlined Workflows and Operational Efficiency
  • How to Search for a String in All Tables in a Database

Recent Posts

  • How to View Stored Procedure Code in SQL Server
  • How to Find a String in SQL Server Stored Procedures
  • How to Remove Cached Credentials without Rebooting Windows
  • ESP Work Automation: Empowering Enterprises with Streamlined Workflows and Operational Efficiency
  • How to Search for a String in All Tables in a Database

Tags

.NET .NET Core AdSense ASP.NET Cdonts Dll Classic ASP Code Editor ETL FSharp Genesis Framework Git Google HP Asset Manager HTML5 Hugo IIS Information Security Internet Internet Information Services iOS JAMStack Linux macOS Microsoft Microsoft SQL Server MVC PHP PowerShell Python Simple Mail Transfer Protocol Smtp Server SQL SQL Server SSIS SSMS SSRS Sublime Text Visual Studio Visual Studio Code VPN Windows Windows 8 Windows 10 Windows 2012 Windows Server

Copyright © 2011-2025 IT Nota. All rights reserved. Terms of Use | Privacy Policy | Disclosure