ASP.NET makes use of a temporary files directory to store files for Shadow Copying and Dynamic Compilation. A typical path will look like this. Note the hash on the end of the path.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\{hash}
I'm using automated deployments and have noticed that these folders and their contents are not automatically removed. I'd like to automate the process of removing unused temp files as part of my deployment process. Such that as soon as the new version of my site is deployed the old temp files are removed.
The hash seems to be generated in a deterministic manner so I'm hoping I'll be able to determine the hash as part of my pre-deployment script and delete it post-deployment.
How is the hash calculated for an ASP.NET website?
References:
CodegenDir
will be from outside the AppDomain/Process of a website. I think my best option is to configuretempDirectory
instead. – Vesicant