更改ASP.NET临时文件文件夹的位置 [英] Changing ASP.NET Temporary Files folder location

查看:140
本文介绍了更改ASP.NET临时文件文件夹的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我们发现Web服务器的C驱动器已满,并且主要原因是ASP.NET临时文件文件夹位置(C:\ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \ Temporary ASP.NET Files).

Recently, we discovered that our web server's C drive was getting full and the primary reason was the ASP.NET Temporary Files folder location (C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files).

我们决定更改此位置,然后将其移动到同一磁盘上具有足够空间的另一个驱动器上.

We decided to change this location and move it to another drive on the same disk which was having enough space.

我们尝试通过添加以下内容来更改网站的网络配置之一:

We tried changing one of the site's web config by adding this:

<compilation tempDirectory="D:\TemporaryASPNETFiles">

这完成了工作,并将该单个网站的临时文件移至D:\ TemporaryASPNETFiles.

That did the work and moved the temp files to D:\TemporaryASPNETFiles for that single website.

现在,我们希望对所有网站都这样做.但是访问每个网站的webconfig并更改tempDirectory将不可行,因为IIS Web服务器上有大量的网站.

Now we want to do the same for all websites. But going to each website's webconfig and changing the tempDirectory will not feasible as we have tons of websites on the IIS web server.

我们也尝试更改以下配置:C:\ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Config,方法是将tempDirectory位置添加到编译标记中:

We tried changing the following config too: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config by adding tempDirectory location to compilation tag:

<compilation tempDirectory="D:\TemporaryASPNETFiles" >

但是它没有任何改变.是否有其他位置可以对所有网站进行更改.

but it didn't make any change. Is there any other location which can do the change for all the websites.

推荐答案

步骤:

  • Web.config 中进行如下所需的修改
  • 重新启动IIS
  • Steps:

    • Make the required modification in Web.config as below
    • Restart IIS
    • 位置:此文件夹是您安装 NET框架

      "C:\ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \ Config \ web.config"

      验证版本:

      System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory();

      web.config

      <system.web>
        <compilation tempDirectory="D:\TemporaryASPNETFiles" />
      </system.web>
      

      编辑

      如OP在评论中所建议,在完成上述步骤后重新启动IIS.

      As suggested by OP in the comments, restarting IIS after the steps did the trick.

      这篇关于更改ASP.NET临时文件文件夹的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆