1

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">

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

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.

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.

Raghav
  • 8,772
  • 6
  • 82
  • 106
  • From this answer, make sure you close your tags and its in . Also did you try machine.config. https://serverfault.com/questions/350550/is-it-possible-to-configure-the-location-of-temporary-asp-net-files-folder-in – Aman Feb 02 '20 at 06:04
  • hey Raghav, may I know if the solution below help answer your question, if yes it would be great if answer can be marked resolved :) ? – Clint Feb 04 '20 at 21:23
  • Sorry for replying late on this, the solution was to restart the IIS after that change. – Raghav Feb 05 '20 at 07:26
  • Sorry for the late reply. – Raghav Feb 20 '20 at 19:25

1 Answers1

3

Steps:

  • Make the required modification in Web.config as below
  • Restart IIS

Location: This folder is a subdirectory of the location where you installed the NET framework

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

Verify Version:

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

web.config

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

EDIT

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

Community
  • 1
  • 1
Clint
  • 6,011
  • 1
  • 21
  • 28