2

I have almost 800 MB and over 31,000 files in hundreds of subfolders at the following file location:

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\temporary asp.net files

Are files truly temporary and are they ever cleaned up? Can they be safely deleted, perhaps, after stopping IIS?

Chad
  • 23,658
  • 51
  • 191
  • 321

4 Answers4

7

They aren't "temporary" in the literal sense of the word that they will definitely be removed at some point. This answer describes the purpose pretty well:

These are what's known as Shadow Copy Folders.

Simplistically....and I really mean it:

When ASP.NET runs your app for the first time, it copies any assemblies found in the /bin folder, copies any source code files (found for example in the App_Code folder) and parses your aspx, ascx files to c# source files. ASP.NET then builds/compiles all this code into a runnable application.

They can be deleted at any time, and .NET will just recreate the ones it needs, when it needs them.

Community
  • 1
  • 1
Rex M
  • 142,167
  • 33
  • 283
  • 313
6

They can be safely deleted after stopping IIS and they will regenerate what is needed when a user accesses your site.

-Shaun

Shaun McDonnell
  • 451
  • 4
  • 10
  • Are they ever automatically cleaned up? I imagine it took a while to accumulate 800 MB worth of files. I'm a little chicken to remove them even though I would tend to also think it is safe. – Chad Sep 02 '09 at 16:59
  • They are not automatically cleaned up but if they are growing too large I would have a scheduled task execute upon recycle of your IIS process to clean them up for you. – Shaun McDonnell Sep 02 '09 at 17:01
3

Yes you can safely delete them.

Mischa
  • 893
  • 5
  • 7
2

I'm just about certain that orphaned (i.e. that don't correspond to virtual directory anymore) temp files are never cleaned up.

MatthewMartin
  • 32,326
  • 33
  • 105
  • 164