且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

什么是"临时ASP.NET文件"文件夹?

更新时间:2022-10-23 17:38:56

这是什么作为影复制文件夹。

简单而言....我真正的意思是:


  

当ASP.NET运行你的应用程序的
  第一次,它会将任何程序集
  在/ bin文件夹中发现,任何复制
  来源$ C ​​$ C文件(找到例如
  在APP_ code文件夹),并解析
  您的ASPX,ASCX文件到C#源
  文件。 ASP.NET然后建立/编译
  这一切code到一个可运行
  应用程序。


块引用>

这样做的一个好处是,它prevents的.NET程序集的DLL#的可能性(在/ bin文件夹)由ASP.NET工作进程变得锁定,因此没有更新。

ASP.NET手表在您的网站文件的更改,并在必要时再次上演的全过程。

理论上的文件夹应该不需要任何维护,但不时,只有很少可能需要删除的内容。这就是说,我的托管公司合作,我们运行高达共享服务器1200网站和我还没有触及该文件夹的任何250种不同的机器好几年了。

这是MSDN文章理解ASP.NET动态编译概述

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?

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