Problem in IIS

Discussion in 'ASP General' started by sara, Jan 25, 2004.

  1. sara

    sara Guest

    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

    ==========================================================
    sara, Jan 25, 2004
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:422801c3e357$e65bed70$...
    >
    >
    >
    > 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
    >
    > ==========================================================
    >
    Aaron Bertrand [MVP], Jan 25, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Grind Boy

    .NET IIS to IIS credentials problem...

    Grind Boy, Aug 13, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    2,435
    Grind Boy
    Aug 14, 2003
  2. Matthew Louden
    Replies:
    3
    Views:
    5,872
    Sherif ElMetainy
    Nov 7, 2003
  3. JMaelstrom

    IIS 6 vs IIS 5 ASP.NET Performance Issues

    JMaelstrom, Dec 9, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    4,650
    shan420
    Apr 30, 2010
  4. Hai Nguyen

    IIS 6.0 vs IIS 5.1

    Hai Nguyen, Feb 5, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,225
    Alvin Bruney [MVP]
    Mar 2, 2004
  5. Joe Kaplan \(MVP - ADSI\)

    Re: Accessing AD from IIS 6 vs IIS 5

    Joe Kaplan \(MVP - ADSI\), May 7, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    419
    Joe Kaplan \(MVP - ADSI\)
    May 7, 2004
Loading...

Share This Page