Access denied to Temp ASP.NET directory
Asked Answered
W

3

7

Please review my UnauthorizedAccessException ASP.NET 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 occured since I changed the website to be hosted through VS 2010 IIS from my machines IIS. My solution has previously worked in VS 2010 IIS as I went from VS IIS to Machine IIS back to VS ISS.

My Problem occurs when I copy dlls to the temp directory.

File.Copy(...

I've tested the various permissions on the directory and nothing helped. i also ran the aspnet_regiis -i command in the hope it would restore the desired permissions on the temp directory.

I dont have any problems if I delete the '../Temporary ASP.NET Directory', it only occurs 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 appreciated. Thanks,

Waler answered 24/2, 2012 at 5:2 Comment(1)
see #917946Lukin
D
5

I have just spent hours troubleshooting this very same issue. In my case the dlls were from a solution that was checked in to SourceSafe and when copied into the temp folder they were marked ReadOnly. Once I removed the ReadOnly attribute the problem went away...

Dees answered 11/4, 2012 at 22:24 Comment(0)
D
2

You didn't mention which version of IIS you were running on. But you can use FileMon or ProcessMon to determine which user and resource is being denied.

Dey answered 24/2, 2012 at 18:22 Comment(3)
Was using VS 2010 Development Server. IIS 6.1 on Windows 7. completly stuck on this one. The problem now occurs on both Servers.Waler
Thanks. I tried other suggestions for this problem to no avail. With ProcessMon it became trivially easy to find the problem.Hax
@JohnRobertson so what was the solution?Helvetia
R
1

With impersonation involved, this can get tricky. Check your web.config for something like

    <identity impersonate="true"  ...

The user that is being impersonated also needs permission to the temp folders. I had to reboot, delete the temp folders, and reboot again until it finally took my changes and compiled without this error ...

Riff answered 25/1, 2013 at 18:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.