Access denied, can't create xml file from ASP.NET
hi everyone,
i am trying to create a .xml file from a ASP.NET web application but i keep getting this error.
///////////////////////////////////////
Access to the path "c:\inetpub\wwwroot\Weblog1Entries\20050221_0207.x ml"
is denied.
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 "c:\inetpub\wwwroot\Weblog1\Entries\20050221_0207. xml" is denied.
The ASP.NET process is not authorized to access the requested resource. For security reasons the default ASP.NET process identity is '{machinename}\ASPNET', which has limited privileges. Consider granting access rights to the resource to the ASP.NET process identity.
Source Error:
95 fileInfo.Delete();
96 FileStream stream = new FileStream(filepath, FileMode.Create);
97 XmlSerializer serializer = new XmlSerializer(this.GetType());
98 serializer.Serialize(stream, this);
Source File: c:\inetpub\wwwroot\weblog1\entry.cs Line: 96
///////////////////////////////////////////
i was getting the same error when trying to open .xml file, but i added the property 'FileAccess.read' to the stream constructor and it was ok. This time its not working!
thanks already...
|