Access denied for ASP.NET Temp directory

Read my ASP.NET UnauthorizedAccessException error.

Access to the path 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\8909a2b1\8566823\Nop.Plugin.Feed.Froogle.dll' is denied. 

The error has occurred since I changed the website, which will be hosted through VS 2010 IIS, from my IIS machines. My solution previously worked in VS 2010 IIS when I switched from VS IIS to Machine IIS back to VS ISS.

My problem occurs when I copy dlls to temp directory.

 File.Copy(... 

I tested various permissions in the directory and nothing helped. I also ran the aspnet_regiis -i command in the hope that it will restore the required permissions in the temp directory.

I have no problem if I delete "../Temporary ASP.NET Directory", this only happens when I try to replace existing files.

 File.Copy("source", "c:\windows\microsoft.net\framework\v4\temporary asp.net files\...\###.dll", true); 

Any help would be greatly appreciated. Thanks,

+7
source share
3 answers

I just spent a few hours fixing the same problem. In my case, the dlls were from a solution that was tested in SourceSafe, and when copying to the temp folder they were marked ReadOnly. As soon as I removed the ReadOnly attribute, the problem disappeared ...

+5
source

You did not specify which version of IIS you are using. But you can use FileMon or ProcessMon to determine which user and resource are failing.

+2
source

With impersonation, this can become complicated. Check your web.config for something like

  <identity impersonate="true" ... 

The user who claims to be working also needs permission to temporary folders. I had to reboot, delete temporary folders and reboot until it finally accepts my changes and compiles without this error ...

+1
source

All Articles