9

How do you prevent ASP.NET from creating too many temporary files? My website creates gigabytes of temporary files, and that overflows the main partition on the server. How do I prevent this from happening?

gersh
  • 2,227
  • 4
  • 23
  • 23
  • What is it in the web site that is creating all the temporary files, and why isn't the web application cleaning up the files itself? – Guffa Feb 25 '09 at 17:15

2 Answers2

7

Where are these temp files beeing generated?

If it's in the "Temporary ASP.NET Files" folder, it's a result of your application beeing recompiled. Checkout MSDN for more information on dynamic compilation. One possible solution could be to relocate the temp directory.

You could try pre-compiling your site to avoid the generation of temp-files.

PHeiberg
  • 29,411
  • 6
  • 59
  • 81
6

Setup a task in the task scheduler to clean up temporary files. I have no idea why this is not done by the OS (or by the creator of those files).

leppie
  • 115,091
  • 17
  • 196
  • 297