Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
I 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. –  Tor Iver Wilhelmsen May 31 '13 at 8:41

1 Answer 1

up vote 7 down vote accepted

You can change the default location on a per website/application basis by editing the Configuration section of the web.config file.

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

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

share|improve this answer
    
Thanks 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. –  Silviu Aug 20 at 13:00

protected by Community Aug 26 at 1:53

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.