RakeshBhandari
asked on
Can't access file on IIS7 Windows Server 2008 R2
Dear Experts,
My asp.net c# application is hosted on IIS7 running on windows server 2008r2.
in that application i access a file on the server, however, i am getting the following error:
Access to the path 'filename' is denied.
i know i am supposed grant asp.net user on the server access to the folder/file by right-clicking & going to security
but the thing is, when i go to do that, i don't see any asp.net user at all!
can you please guide me about giving permissions so that i can access the file from my web application?
My asp.net c# application is hosted on IIS7 running on windows server 2008r2.
in that application i access a file on the server, however, i am getting the following error:
Access to the path 'filename' is denied.
i know i am supposed grant asp.net user on the server access to the folder/file by right-clicking & going to security
but the thing is, when i go to do that, i don't see any asp.net user at all!
can you please guide me about giving permissions so that i can access the file from my web application?
ASKER
i tried this already and hasn't worked for me
is there anything else i can do... or is there a workaround?
is there anything else i can do... or is there a workaround?
Hi, I need more info to be able to give you a solution to your problem.
Please copy this aspx page into your web application folder where is your page that is trying to access the file, then open it from your web browser and post here the displayed info:
Im.aspx
The page just display user authentication info and the windows identity info that is running your page, that will give me enough info to know what action to take.
Please copy this aspx page into your web application folder where is your page that is trying to access the file, then open it from your web browser and post here the displayed info:
Im.aspx
The page just display user authentication info and the windows identity info that is running your page, that will give me enough info to know what action to take.
ASKER
here's the info :
User
AuthenticationType:
Name:
IsAuthenticated: False
WindowsIdentity
Name: IIS APPPOOL\DefaultAppPool
AuthenticationType: Negotiate
ImpersonationLevel: None
IsAnonymous: False
IsAuthenticated: True
IsGuest: False
IsSystem: False
User
AuthenticationType:
Name:
IsAuthenticated: False
WindowsIdentity
Name: IIS APPPOOL\DefaultAppPool
AuthenticationType: Negotiate
ImpersonationLevel: None
IsAnonymous: False
IsAuthenticated: True
IsGuest: False
IsSystem: False
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i did that already and still i am getting the same error!
ASKER
well... i rebooted the machine (without making any more changes apart from the one in your screenies) and voila! it works!!
thank you very much!!!
thank you very much!!!
Good! Hehe that this happens in the Windows World ;)
I meant: that THINGS happens in the Windows World ;)
You need to grant access to:
Open in new window
over the files/folders in the security tab (add this account manually if not appears in the object list).Also you can try change your ASPNET application pool identity by selecting it from the IIS console and changing its advanced settings, then set the identity to NETWORKSERVICE and grant access to this account over your files.
More info about IIS7 application pool identities on Windows Server 2008 R2:
http://learn.iis.net/page.aspx/624/application-pool-identities/