473,491 Members | 1,965 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Cannot write XML

I am having trouble writing an XML file out on my
localhost development machine.

I get:
Server Error in '/ProblemSolved' Application.
-----------------------------------------------------------
---------------------

Access to the
path "c:\inetpub\wwwroot\ProblemSolved\XMLData\Products .xml
" 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\ProblemSolved\XMLData\Products .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.

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 "{machinename}
\ASPNET" user. Highlight the ASP.NET account, and check
the Write box in the Allow column.

Source Error:
Line 101:
Line 102: private void SaveProducts() {
Line 103: _dsProducts.WriteXml
(Server.MapPath("../XMLData/Products.xml"));
Line 104: }
Line 105:
Source File:
c:\inetpub\wwwroot\problemsolved\maintenance\produ cts.aspx.
cs Line: 103

Stack Trace:
[UnauthorizedAccessException: Access to the
path "c:\inetpub\wwwroot\ProblemSolved\XMLData\Products .xml
" is denied.]
System.IO.__Error.WinIOError(Int32 errorCode, String
str) +393
System.IO.FileStream..ctor(String path, FileMode mode,
FileAccess access, FileShare share, Int32 bufferSize,
Boolean useAsync, String msgPath, Boolean bFromProxy) +859
System.IO.FileStream..ctor(String path, FileMode mode,
FileAccess access, FileShare share) +45
System.Xml.XmlTextWriter..ctor(String filename,
Encoding encoding)
System.Data.DataSet.WriteXml(String fileName,
XmlWriteMode mode)
System.Data.DataSet.WriteXml(String fileName)
ProblemSolved.Maintenance.Products.SaveProducts() in
c:\inetpub\wwwroot\problemsolved\maintenance\produ cts.aspx.
cs:103

ProblemSolved.Maintenance.Products.dgProducts_Item Command
(Object source, DataGridCommandEventArgs e) in
c:\inetpub\wwwroot\problemsolved\maintenance\produ cts.aspx.
cs:128
System.Web.UI.WebControls.DataGrid.OnItemCommand
(DataGridCommandEventArgs e)
System.Web.UI.WebControls.DataGrid.OnBubbleEvent(O bject
source, EventArgs e)
System.Web.UI.Control.RaiseBubbleEvent(Object source,
EventArgs args)
System.Web.UI.WebControls.DataGridItem.OnBubbleEve nt
(Object source, EventArgs e)
System.Web.UI.Control.RaiseBubbleEvent(Object source,
EventArgs args)
System.Web.UI.WebControls.LinkButton.OnCommand
(CommandEventArgs e)

System.Web.UI.WebControls.LinkButton.System.Web.UI .IPostBac
kEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent
(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent
(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()
I am running on XP Professional.

What I have tried:
- right-click the file in Explorer, choose "Properties"
and select the Security tab. --> There is NO such tab. I
am given General, Sharing, WebSharing
- I have made sure both the directory and file are NOT
read-only
- I have given the ASPNET account Administrator
priveledges.
- I have set the "local Intranet" security to FULL access -
no restrictions.
- I have set the DLL security to FULL access - no
restriction
- I have shared out the drive with no restrictions
(read/write permission)
- I have shared out the directory with no restrictions
(read/write permission)
- I have read every one else's suggestions and (like most
people with this problem). Switching to Windows Server
2003 is not an option at this time (down the road fine,
but I have customers who aren't going to switch just
because I have this little problem)

I am completely stymied and have been unable to get around
this for the past several days. PLEASE somebody help me -
I am dead in the water and have been for several days. I
really don't want to give up on XML and switch to a
database for this application and I really really really
don't want to have to go back to J2EE. But I may have to
if I can't find a solution.

Nov 11 '05 #1
0 3024

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
10303
by: Christopher Brandsdal | last post by:
Hi! I get an error when I run my code Is there any other way to get te information from my form? Heres the error I get and the code beneath. Line 120 is market with ''''''''''''Line...
3
2574
by: Pixie | last post by:
I need help with this program, if anyone can give input. I can think of how to do it, but it is hard for me to put into the program. I realize that I am trying to separate out a certain digit...
10
4417
by: Jean-David Beyer | last post by:
I have some programs running on Red Hat Linux 7.3 working with IBM DB2 V6.1 (with all the FixPacks) on my old machine. I have just installed IBM DB2 V8.1 on this (new) machine running Red Hat...
2
7191
by: Jim in Arizona | last post by:
I'm learning form an ASP.NET 1.0 book and I tried out some code that returns this error: Compiler Error Message: BC30311: Value of type 'Integer' cannot be converted to...
6
9141
by: sambuela | last post by:
How can I write message to the file located in the wwwroot directory? It seems that IIS protect these files. Let make me cannot do the I/O writing sucessfully. I try to open file's write...
5
6668
by: lmttag | last post by:
ASP.NET 2.0 (C#) application Intranet application (not on the Internet) Using Windows authentication and impersonation Windows Server 2003 (IIS6) Server is a member server on a domain Logged...
0
1126
by: LamSoft | last post by:
I cannot get values from detailview, here is the demo code... <Fields> <asp:BoundField DataField="serverip" HeaderText="Server IP" ReadOnly="true" SortExpression="serverip" /> <asp:BoundField...
1
2447
by: teenagelcruise | last post by:
hi, i have a problem with my code which is i cannot update and addnew data into the database but i can delete the data.plz give me an idea.this is my code that i wrote. <html> <head> <meta...
3
8044
by: Okonita | last post by:
Hi all, I am having problem completing this restore operation. "db2 restore database AAMI01 from /pap/data/backups taken at 20071002130554 to /pap/data/db01 into AAMI01 NEWLOGPATH /pap/data/new/...
5
2310
by: Just_a_fan | last post by:
I tried to put an "on error" statement in a routine and got the message that I cannot user "on error" and a lamda or query expression in the same routine. Help does not list anything useful for...
0
7190
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5451
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4881
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4578
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3086
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3076
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1392
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
280
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.