Search code examples
asp.net.netteamcitytemporary-files

Temporary ASP.NET files & TeamCity


Our TeamCity agent machines have been struggling for disk space recently. I did a little snooping on each of the machines to find that the Temporary ASP.NET folder in the .NET installation directory was taking up more than 10GB of space on each box, each folder comprising of about 5MB each.

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files

I've done my research on the subject and I know that the files are a biproduct of ASP.NET's dynamic compliation, I also understand how IIS uses them for request optimisation (See: Understanding ASP.NET Dynamic Compilation)

What I don't understand is why no one else is complaining about how these files are taking up disk space on their build servers when they really only need to be used on their web servers.

Surely someone out there has run into this problem before, can anyone offer me a solution other than

  1. Disabling dynamic compliation (outlined here)
  2. Doing a brute force scheduled job deletion (outlined here)

Solution

  • In the end I had to settle for a PowerShell script that is run once a month as scheduled task, I followed Bredan's process outlined in this SysAdminSpot post, with only a few modifications