How to resolve error "The current identity (IIS APPPOOL...) does not have write access to " error

Hi,

Yesterday I was just playing with some small site that I've created and published from Visual Studio when I bumped into this error:

The current identity (IIS APPPOOL\cc) does not have write access to
'C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files'.

I started looking around and I've seen some people complaining about the same issues, but none that is specifically about the problem that I was encountering. I was sure it has something to do with the access to the folder, but looking through all the settings for the website in in IIS Manager I dind't find any that could be the culprit. But luckly I started looking a bit at the settings for the application pool that's corresponding to my site and I noticed that it's running under the "ApplicationPoolIdentity" Identity. I thought it might be worth it to give it a try by running it under NetworkService. And guess what?!? That completely solved my problem.

Here's a step by step explanation of how I got the error and what I did to fix it:

I've developed my website in VS2010, I went to the site in the solution view, right click select "Publish Web Site"

After getting the binaries on the drive I've went in IIS and created the actual website:

After doing this I happily browsed to my site, which blew up on me...


Server Error in '/' Application.


The current identity (IIS APPPOOL\mywebsite) does not have write access
to 'C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET
Files'.

Description:
An unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the error and
where it originated in the code.
Exception Details:
System.Web.HttpException: The current identity (IIS APPPOOL\mywebsite) does
not have write access to
'C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files'.


And here's how to get rid of this error: 

  • Go to IIS Manager
  • Open the Application Pools
  • Select the pool corresponding to your website (most of the time it will have the same name as the website)
  • Select "Advanced Settings"
  • You will see that the app is running under the "ApplicationPoolIdentity" Indetity
  • Change that to "NetworkService" identity

Well folks, there you have it, hopefully this will save a poor soul a couple of hours of digging :)

Let me know if this solution worked for you or not,
Ionutz