164

I've discovered this folder in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files and have a few questions.

  • What does ASP.NET use this folder for, and what sort of files are stored here?
  • How does a file get stored here, and when is it updated?
  • Does the folder need any sort of maintenance?
J0e3gan
  • 8,740
  • 10
  • 53
  • 80
Alex Angas
  • 59,219
  • 41
  • 137
  • 210
  • 11
    In case any one is looking for this directory it seems to have moved to `C:\Users\[Username]\AppData\Local\Temp\Temporary ASP.NET Files`. – Peter Apr 26 '16 at 10:58

3 Answers3

183

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.

One advantage of doing this is that it prevents the possibility of .NET assembly DLL's #(in the /bin folder) becoming locked by the ASP.NET worker process and thus not updatable.

ASP.NET watches for file changes in your website and will if necessary begin the whole process all over again.

Theoretically the folder shouldn't need any maintenance, but from time to time, and only very rarely you may need to delete contents. That said, I work for a hosting company, we run up to 1200 sites per shared server and I haven't had to touch this folder on any of the 250 or so machines for years.

This is outlined in the MSDN article Understanding ASP.NET Dynamic Compilation

John
  • 29,788
  • 18
  • 89
  • 130
Kev
  • 118,037
  • 53
  • 300
  • 385
  • Hi Kev, I have a com dll, which is geting copied into this folder, dll needs some config files in its current folder inorder to execute. how can i ensure that they are also copied into this folder? – Rakesh Jan 10 '14 at 06:44
  • 2
    @robot - You probably already found the answer, but for the sake of future readers, you can find the "original" location of the DLL using Reflection and then access the config files that way. See http://stackoverflow.com/a/837501/211627 – JDB Apr 19 '15 at 03:55
  • 3
    This folder seems to be filling up for me due to continuous integration - every time the site is deployed (several times a day), a new copy gets created in the folder - 29GB so far. – Andy Joiner May 15 '15 at 15:14
  • 5
    As a web site hosting service maybe you never touch this folder, but for developers it is by far the biggest headache we have to deal with.I have spend many whole days trying to resolve what should be trivial issues, but the combination of IIS shadow copy and Visual Studio Web Site style projects are a nightmare to work with and I have to clear the contents on this folder multiple times every day. – bikeman868 Jul 18 '16 at 01:37
10

The CLR uses it when it is compiling at runtime. Here is a link to MSDN that explains further.

J0e3gan
  • 8,740
  • 10
  • 53
  • 80
cgreeno
  • 31,943
  • 7
  • 66
  • 87
4

Thats where asp.net puts dynamically compiled assemblies.

StingyJack
  • 19,041
  • 10
  • 63
  • 122