简体   繁体   English

什么是“Temporary ASP.NET Files”文件夹?

[英]What is the “Temporary ASP.NET Files” folder for?

I've discovered this folder in C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\Temporary ASP.NET Files and have a few questions. 我在C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\Temporary ASP.NET Files发现了这个文件夹,并有几个问题。

  • What does ASP.NET use this folder for, and what sort of files are stored here? ASP.NET使用此文件夹的内容以及此处存储的文件类型是什么?
  • How does a file get stored here, and when is it updated? 如何在此处存储文件,以及何时更新?
  • Does the folder need any sort of maintenance? 文件夹是否需要任何维护?

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第一次运行您的应用程序时,它会复制在/ bin文件夹中找到的任何程序集,复制任何源代码文件(例如在App_Code文件夹中找到)并将您的aspx,ascx文件解析为c#源文件。 ASP.NET then builds/compiles all this code into a runnable application. 然后,ASP.NET将所有这些代码构建/编译为可运行的应用程序。

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. 这样做的一个优点是它可以防止.NET程序集DLL的#(在/ bin文件夹中)被ASP.NET工作进程锁定,从而无法更新。

ASP.NET watches for file changes in your website and will if necessary begin the whole process all over again. ASP.NET会监视您网站中的文件更改,并在必要时重新开始整个过程​​。

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. 也就是说,我为一家托管公司工作,我们每台共享服务器运行多达1200个站点,而且我不需要在250台左右的任何一台机器上触摸这个文件夹多年。

This is outlined in the MSDN article Understanding ASP.NET Dynamic Compilation 这在MSDN文章了解ASP.NET动态编译中进行了概述

The CLR uses it when it is compiling at runtime. CLR在运行时编译时使用它。 Here is a link to MSDN that explains further. 以下是MSDN的链接,进一步说明。

这就是asp.net放置动态编译程序集的地方。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM