Christo
Christo

Reputation: 2370

Access denied to Temp ASP.NET directory

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,

Upvotes: 7

Views: 16088

Answers (3)

cdonner
cdonner

Reputation: 37668

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 ...

Upvotes: 1

Anonymous
Anonymous

Reputation: 66

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...

Upvotes: 5

Nathan Rice
Nathan Rice

Reputation: 3111

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.

Upvotes: 2

Related Questions