Shoukat_1983 Posted April 6, 2006 Share Posted April 6, 2006 I have an xml file and i want to use it in my ASP.Net (C#) application. Everything is working fine but when i run application i get the following erros.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.UnauthorizedAccessException: Access to the path "F:\My downloads\7582_BegVCSharpEnd\BegVCSharpEnd\Chapter23\Weblog\Entries\20010717_1607.xml" is denied. ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user. To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.The solution above suggested is some thing that i didn't understand and i tried more than 10 times to follow the solution above suggeste but i couldn't do so. Link to comment Share on other sites More sharing options...
aspnetguy Posted April 6, 2006 Share Posted April 6, 2006 You need to give access permissions to the xml file. The best thing to do would to give the folder that holds the xml file the proper permissions and then set the xml file to inherit it's permissions from its parent (the folder).If you are running IIS5 (XP) the asp.net user account is ASPNET and if you run IIS6(Win server 2003) then the user account is NETWORK SERVICE.You must give the proper user account write permissions to the xml file. Link to comment Share on other sites More sharing options...
Shoukat_1983 Posted April 7, 2006 Author Share Posted April 7, 2006 Plz can you explain your solution in more detail because in the properties of the folder containing the xml files i share the folder with the default web site on IIS5(XP) but still i receive the same error........ Link to comment Share on other sites More sharing options...
aspnetguy Posted April 7, 2006 Share Posted April 7, 2006 PLease right click the xml file. choose PropertiesGo to the Security tab.You said you are using IIS5 right?So if there is not a user account called ASPNET in the list you need to add it and give it Read and Write permissions. Link to comment Share on other sites More sharing options...
Shoukat_1983 Posted April 8, 2006 Author Share Posted April 8, 2006 Heay Dude there no option of the scurity in the properties of the xml file in windows XP. So Plz is there anyother solution Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now