I'm developing a simple ASP.NET Website on desktop, the code for creating directory given below works perfect. But when I place the same site under IIS prompt the error.
My Create Directory Code:-
Directory.CreateDirectory(root + "\\users\\2011\\" + username);
[Here String root = Server.MapPath("~"); and String username=txtUsername.text]
My Error Msg when site under IIS:-
Access to the path 'C:\inetpub\wwwroot\Website1\users\2011\sillyme' is denied.
Note, in above line 'sillyme' is new directory name.
Maybe this is an issue for some permission to create dynamic directory inside IIS because when I place my site outside IIS or say on desktop works fine.
How to fix or say grant permission to create the dynamic folder under IIS?
Loading

Soft CornerPosted Apr 28, 2011, 7:07 AM
I think you need to set Permissions for Virtual directory inside IIS7, On clicking virtual dirc. -> then in Features View there is an option Application Settings .. here you will need to Edit Permission for Network Service to Full Control .
I am totally not sure with this solution but you can try.
Abhimanyu K VatsaPosted Apr 28, 2011, 7:21 AM
its cool and working....thanks friend