Problem in IIS

S

sara

Hi Mr,
I have a problem .
I have created an Xml file ,I can read from it but
I cant write in it .
when I want to write to it ,IIS showes me the following
error page .

please help me , what is my problem ?

Thank you






==========================================================
Server Error in '/go' Application.
----------------------------------------------------------
----------------------

Access to the path "E:\go\Xml\Users.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 "E:\go\Xml\Users.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.

Source Error:


Line 55: (Password, "SHA1")
Line 56: dsUsers.Tables("users").Rows.Add(rowUser)
Line 57: dsUsers.WriteXml(strXMLFile,
XmlWriteMode.WriteSchema)
Line 58: Return True
Line 59: 'Catch ex As Exception


Source File: E:\go\Classes\MainClass.vb Line: 57

Stack Trace:


[UnauthorizedAccessException: Access to the
path "E:\go\Xml\Users.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) +888
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)
go.MainClass.AddUser(String UserName, String Password)
in E:\go\Classes\MainClass.vb:57
go.AddUserWebForm.ButAdduser_Click(Object sender,
EventArgs e) in E:\go\WebForms\AddUserWebForm.aspx.vb:40
System.Web.UI.WebControls.Button.OnClick(EventArgs e)

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEv
entHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent
(IPostBackEventHandler sourceControl, String
eventArgument)
System.Web.UI.Page.RaisePostBackEvent
(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain() +1277

==========================================================
 
A

Aaron Bertrand [MVP]

Looks like a permissions issue to me. And one that the folks in an ASP.NET
newsgroup would be better equipped to help you with than here.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/




sara said:
Hi Mr,
I have a problem .
I have created an Xml file ,I can read from it but
I cant write in it .
when I want to write to it ,IIS showes me the following
error page .

please help me , what is my problem ?

Thank you






==========================================================
Server Error in '/go' Application.
----------------------------------------------------------
----------------------

Access to the path "E:\go\Xml\Users.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 "E:\go\Xml\Users.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.

Source Error:


Line 55: (Password, "SHA1")
Line 56: dsUsers.Tables("users").Rows.Add(rowUser)
Line 57: dsUsers.WriteXml(strXMLFile,
XmlWriteMode.WriteSchema)
Line 58: Return True
Line 59: 'Catch ex As Exception


Source File: E:\go\Classes\MainClass.vb Line: 57

Stack Trace:


[UnauthorizedAccessException: Access to the
path "E:\go\Xml\Users.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) +888
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)
go.MainClass.AddUser(String UserName, String Password)
in E:\go\Classes\MainClass.vb:57
go.AddUserWebForm.ButAdduser_Click(Object sender,
EventArgs e) in E:\go\WebForms\AddUserWebForm.aspx.vb:40
System.Web.UI.WebControls.Button.OnClick(EventArgs e)

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEv
entHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent
(IPostBackEventHandler sourceControl, String
eventArgument)
System.Web.UI.Page.RaisePostBackEvent
(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain() +1277

==========================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top