Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old February 21st, 2005, 12:41 AM
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 'FileAccess.read' to the stream constructor and it was ok. This time its not working!

thanks already...


Reply With Quote
  #2 (permalink)  
Old February 21st, 2005, 03:12 PM
Friend of Wrox
 
Join Date: Jul 2004
Location: Tehran, , Iran.
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

Grant the Write permission to your ASP.NET account for that folder.

_____________
Mehdi.
software student.
Reply With Quote
  #3 (permalink)  
Old February 21st, 2005, 03:32 PM
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

thanks...it worked!
you helped a lot.
Reply With Quote
  #4 (permalink)  
Old February 27th, 2007, 04:50 AM
Authorized User
 
Join Date: Nov 2006
Location: islamabad, CT, Pakistan.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i am trying to do this too but is not working. i granted permission to ASP.NET account for to write in a XML file, but still it says " Access Denied!" what shall i do?

payab
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Create word file in asp.net,c# mohini ASP.NET 2.0 Professional 11 March 1st, 2012 05:38 AM
Access is denied" load a simple xml file nana XML 12 May 12th, 2010 07:01 AM
Access Denied when I send fax in ASp.NET 2.0 patel_mitesh ASP.NET 2.0 Professional 0 September 20th, 2006 07:15 AM
Can I create my own File Field control in ASP.Net vbmazza ASP.NET 1.0 and 1.1 Professional 1 February 22nd, 2006 10:45 AM
access denied when uploading file daliaca BOOK: ASP.NET Website Programming Problem-Design-Solution 1 January 16th, 2005 10:08 AM



All times are GMT -4. The time now is 03:20 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.