View Single Post
  #1 (permalink)  
Old February 21st, 2005, 01:41 AM
goldablasha goldablasha is offline
Registered User
Join Date: Feb 2005
Location: Rio de Janeiro, , Brazil.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to goldablasha
Default 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 '' to the stream constructor and it was ok. This time its not working!

thanks already...

Reply With Quote