Reputation: 12705
I was looking for the the trick to resolve that error (google, stackoverflow.com etc) and every nothing works. I need to dynamically create an .aspx file via the asp.net application.
What I've done to try fix it:
1) In the folder's Properties -> Security, I've added IUSR_TONY and also IIS_IUSRS and allow them the Full control to the folder. Just to check if that will help. Nope, it won't.
2) in the IIS Manager, I tried to change the Application's Pool Defaults Identity (based on that) I checked all options, with no success
I don't know what to do more to fix it. Any ideas ?
Upvotes: 4
Views: 9005
Reputation: 1503
Directions for IIS 6
You need to change the 'Home Directory' permissions with IIS Manager.
Open Properties on the website. Select the 'Home Directory' tab. Check the 'Write' checkbox to enable write permissions.
If you are set on doing this, I would suggest only enabling write on a particular directory and not the entire website. Changing the permissions for a single directory is the same as above except instead of selecting Properties for the entire website, choose Properties for the directory where you will be creating files.
Directions for IIS 7
Edit Permissions
Security
tabEdit...
under the group and users listIIS_IUSRS
from the "Groups or user names" list and add make sure the Allow
checkbox is marked for Write
.I know this sounds a lot like what you did in 1) of your question but I'm guessing you may just edited the permissions through Windows Explorer rather than IIS Manager. Let me know what error(s) you see if the steps above still don't work for you.
I tested writing a file to disk using an example from aspalliance.com and it worked great when I granted IIS_IUSRS
write permission to the output directory and stopped working when I removed the write permission.
Upvotes: 2
Reputation: 121037
Please state your operating system and version of IIS.
You need to grant access to the account that is running the app-pool in IIS. It is usually NT Authority\Network Service, so try granting full control to that account.
However, if you are using windows integrated security (and have impersonation=true) on your website, the user that must be granted access, is the user requesting the page.
Finally, I really want to discourage you from making a blog system that creates aspx files on the fly. It's simply not the way to do it.
Upvotes: 1