IIS 8, How do I give ASP.NET permission to write to a folder in Windows 8

iis

Solution

(Moving my comment to an answer for sweet, sweet karma)

I think the problem is the identity that your Anonymous requests are using. What is your IIS Anonymous Authentication identity set to? It might not be set to "Application pool identity" which would be causing your problems

Problem

I published my mvc application to my local IIS version 8. The application needs write temp files into a local folder, e.g. d:\my mvc\temp. My application pool is the DefaultAppPool, the Identity is ApplicationPoolIdentity. I selected the d:\my mvc\temp in windows explorer and add IIS_IUsers for the folder, and gives full control permission. I tried to add local service, Network, network service read and write permissions. These do not work as well. But the application is still unable to write a file into the folder. Questions are how can I let the application write into a local folder and for security reason is giving the IIS_IUsers permisstion a good practice? Thank you.

Original source