Old Temp Files are not deleting by Octopus

When Octopus does new deployment to our environment , the IIS app directory is changed to the new build folder location, but for some reason it is not deleting the old temporary ASP.net files. There is a whole bunch of files collecting in a Temp directory from each deployment, which is consuming gigs of space.

How can we enable Octopus to delete the temp ASP.net files for each new deployment?


This is the first time anyone has asked about this - being temp files, ASP.NET should be deleting them itself (I would have assumed). Is it possible you have other processes locking files in those folders preventing ASP.NET from deleting them?

Can you share:

  • What version of Windows you are using
  • Is it 32bit or 64bit Windows
  • What version of ASP.NET are you using?


Hi Paul,
Thanks for the response. We are using

Windows Server 2008 R2 Datacenter
64-bit windows
ASP.NET version 4


Hi Paul,

We actually do have the same problem. Is there any solution for that problem?


Thanks all,

We’re going to review retention policies in Octopus 2.0; I think we’ll look at cleaning up these temporary files for old deployments as part of the retention policies.


I’m also having this problem. I’m using octopus 2.0 and the problem still exists.
I just deleted 50 GB of temporary asp.net files on our continuous integration build test machine. Every day octopus deploy 3 different branches consisting of 20 projects to the same test machine. To Asp.net thats a lot of different Asp.Net applications so the cache is never cleaned.

Is this issue still somewhere in the backlog?

Hi Anelisse,

We looked into this, but found that there’s no way to actually know where the temporary ASP.NET files will be kept for a given deployment, so we have no way to clear them.

The workaround we suggest is to always deploy your application to the same folder - you can do this using the Custom Installation Directory feature on your package step in Octopus. This will ensure the package is always deployed to the same place, and therefore that the same ASP.NET temporary folder will be reused.