Changing ASP.net Temporary Files Folder
One of my client was having problems with the small space on the C drive on a server machine which was hosting a ASP.net application. There were few errors in the server error about “No enough space”.Though I would say that in ideal situation it would be best to increase the space on the C: drive as most of the other Operating System related applications also reply on the free space on C: drive, when there is no other easy way of increasing the space on C: drive, administrator can relocate the temporary files folder created by ASP.net.
Please note that ASP.net create a compile version of the site and stores it in its default temporary ASP.net folder. This is usually %Windows Install Folder%Microsoft.NETFrameworkv2.0.50727Temporary ASP.NET Files (For ASP.Net 2.0). This folder can grow very fast in case web server has large ASP.net sites hosted on that server. Fortunately, ASP.net provides a simple way to change this location. This is stored in the web.config file and can defined in the Global web.config (placed at %Windows Install Folder%Microsoft.NETFrameworkv2.0.50727CONFIG). To change this path add the new full folder path in the Compilation section of the configuration file. Here is a sample of how this looks like (this must be under System.Web section):
<compilation tempDirectory=“E:ASP.Net Temporary Folder” debug=“false“>
One can find the documentation of all different sections of ASP.net configuration file at:
http://msdn2.microsoft.com/en-us/library/b5ysx397(VS.71).aspx
In case when Internet is not available, or you just need a quick reference, there is also a small helpful file in the configuration folder. This file is named “web.config.comments” and is in the CONFIG folder of the ASP.net framework folder.
This entry was posted
on Saturday, November 10th, 2007 at 8:05 pm and is filed under ASP.Net, C#, Windows.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
Hi Syed G Akbar,
This post really gave me a good timely solution
Although you posted this article in Nov-2007 but today I was facing the same issue and applied your tip to solve the disk-space problem in system-volume in server
Neverthless to say I was actually grealtly benefitted
Thanks / Best Regards
mastervbnet