Is it possible to configure the location of "Temporary ASP.NET Files" folder in IIS?
You can change the default location on a per website/application basis by editing the Configuration section of the Web.config
file.
<system.web>
<compilation tempDirectory="D:\MyTempFiles" />
</system.web>
The application will re-compile and the files will be stored at this new location, after which you can safely remove the old folders. Note that the folder names will stay the same; e.g. if the old location was:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\9878g103\e67805p7
then the new one will be:
D:\MyTempFiles\root\9878g103\e67805p7
Related videos on Youtube
PanJanek
Updated on September 18, 2022Comments
-
PanJanek almost 2 years
Under IIS7.5 after switching pool identity to domain user I got this error:
"The current identity (domain\username) does not have write access to 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files'."
I could grant the user rights to this specific directory, but I wonder if there is a better solution. Ideally I would like to configure this "Temporary ASP.NET Files" directory to be stored in some other location.
-
Tor Iver Wilhelmsen about 11 yearsI have also received the error message when accidentally trying to run a .Net 3.5 web service app on a (default) .Net 2.0 app pool; switching to a .Net 4.0 app pool solved that.
-
-
Silviu almost 10 yearsThanks a lot ShaneH for your answer. The change that you mentioned need not be on a per website/application basis. You can apply that change on a framework version basis by changing the framework's web.config file, for example: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config. By doing this you impact all the websites that are targeting that version of the framework.
-
CoderTao about 9 yearsJust to note, this belongs in the system.web section of the web.config
-
splattne about 9 years@Silviu Just a warning: if you have a lot of webs on the server, it could take minutes to perform the compilation(s)
-
Evgeni Nabokov about 7 yearsI added this section to machine.config. It works.