简体   繁体   English

ASP.NET临时文件清理

[英]ASP.NET Temporary files cleanup

Can I safely delete the contents of this folder 我可以安全地删除此文件夹的内容

C:\\WINDOWS\\Microsoft.NET\\Framework\\v4.0.30319\\Temporary ASP.NET Files\\root

on a Windows 2003 R2 standard system, given that I am not using IIS (6/7) on it? 在Windows 2003 R2标准系统上,假设我没有使用IIS(6/7)吗?

If that is the case, could you please point me to the relevant documentation about ASP.NET's runtime and maintenance tasks such as this? 如果是这种情况,请您指出有关ASP.NET的运行时和维护任务的相关文档,例如:

Yes, it's safe to delete these, although it may force a dynamic recompilation of any .NET applications you run on the server. 是的,删除它们是安全的,尽管它可能会强制重新编译您在服务器上运行的任何.NET应用程序。

For background, see the Understanding ASP.NET dynamic compilation article on MSDN. 有关背景信息,请参阅MSDN上的了解ASP.NET动态编译文章。

Just an update on more current OS's (Vista, Win7, etc.) - the temp file path 只是更新当前操作系统(Vista,Win7等)的更新 - 临时文件路径 has changed 已经改变 may be different based on several variables. 基于几个变量可能有所不同。 The items below are not definitive, however, they are a few I have encountered: 以下项目不是确定的,但是,我遇到的是一些:

"temp" environment variable setting - then it would be: “temp”环境变量设置 - 那么它将是:

%temp%\Temporary ASP.NET Files

Permissions and what application/process (VS, IIS, IIS Express) is running the .Net compiler. 权限以及正在运行.Net编译器的应用程序/进程(VS,IIS,IIS Express)。 Accessing the C:\\WINDOWS\\Microsoft.NET\\Framework folders requires elevated permissions and if you are not developing under an account with sufficient permissions then this folder might be used: 访问C:\\ WINDOWS \\ Microsoft.NET \\ Framework文件夹需要提升权限,如果您没有在具有足够权限的帐户下进行开发,则可能会使用此文件夹:

c:\Users\[youruserid]\AppData\Local\Temp\Temporary ASP.NET Files

There are also cases where the temp folder can be set via config for a machine or site specific using this: 在某些情况下,可以通过配置为特定的机器或站点设置临时文件夹:

<compilation tempDirectory="d:\MyTempPlace" />

I even have a funky setup at work where we don't run Admin by default, plus the IT guys have login scripts that set %temp% and I get temp files in 3 different locations depending on what is compiling things! 我甚至在工作中有一个时髦的设置,默认情况下我们不运行Admin,而且IT人员有登录脚本设置%temp%,我根据编译的东西在3个不同的位置获得临时文件! And I'm still not certain about how these paths get picked....sigh. 我仍然不确定如何挑选这些路径......叹息。

Still, dthrasher is correct, you can just delete these and VS and IIS will just recompile them as needed. 仍然, dthrasher是正确的,您可以删除这些,VS和IIS将根据需要重新编译它们。

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

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