我在 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
中发现了此文件夹,并且有几个问题。
- ASP.NET 使用此文件夹做什么?此处存储什么类型的文件?
- 文件如何存储在此处以及何时更新?
- 该文件夹是否需要任何维护?
最佳答案
这些就是所谓的卷影复制文件夹。
简单地说......我是认真的:
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.
这样做的一个优点是,它可以防止 .NET 程序集 DLL 的#(在/bin 文件夹中)被 ASP.NET 工作进程锁定,从而无法更新。
ASP.NET 监视您网站中的文件更改,并在必要时重新开始整个过程。
理论上,该文件夹不需要任何维护,但有时,只有极少数情况下您可能需要删除内容。也就是说,我在一家托管公司工作,我们在每个共享服务器上运行多达 1200 个站点,而且我已经很多年没有在这 250 台左右的机器上接触过这个文件夹了。
MSDN 文章 Understanding ASP.NET Dynamic Compilation 对此进行了概述。
关于asp.net - "Temporary ASP.NET Files"文件夹有什么用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/450831/