Access to a file is denied

Discussion in 'ASP .Net' started by =?Utf-8?B?Tmltcm9kIFJvdG5lcg==?=, Jun 7, 2007.

  1. Hi,
    I am trying to create an html based on two main objevts: XslTransform and
    XmdTextWrite via asp.net2003 application.
    I keep getting a strange msg: "Access to the path... is denied".

    Here is my method:
    -----------------------
    XmlDataDocument xmlDoc=

    new XmlDataDocument();
    xmlDoc.DataSet.ReadXml(Server.MapPath("test.xml"));

    XslTransform tran=

    new XslTransform();
    tran.Load(Server.MapPath("test.xsl"));

    XmlTextWriter w=new
    XmlTextWriter(Server.MapPath("test.html"),System.Text.Encoding.UTF8);
    tran.Transform(xmlDoc,

    null,w);
    w.Close();
     
    =?Utf-8?B?Tmltcm9kIFJvdG5lcg==?=, Jun 7, 2007
    #1
    1. Advertising

  2. Hello Nimrod,

    exception on Server.MapPath("test.xml") or on ReadXml?
    Seems that user has no rights to read file

    ---
    WBR, Michael Nemtsev [.NET/C# MVP].
    My blog: http://spaces.live.com/laflour
    Team blog: http://devkids.blogspot.com/

    "The greatest danger for most of us is not that our aim is too high and we
    miss it, but that it is too low and we reach it" (c) Michelangelo

    NN> Hi,
    NN> I am trying to create an html based on two main objevts:
    NN> XslTransform and
    NN> XmdTextWrite via asp.net2003 application.
    NN> I keep getting a strange msg: "Access to the path... is denied".
    NN> Here is my method:
    NN> -----------------------
    NN> XmlDataDocument xmlDoc=
    NN> new XmlDataDocument();
    NN> xmlDoc.DataSet.ReadXml(Server.MapPath("test.xml"));
    NN>
    NN> XslTransform tran=
    NN>
    NN> new XslTransform(); tran.Load(Server.MapPath("test.xsl"));
    NN>
    NN> XmlTextWriter w=new
    NN> XmlTextWriter(Server.MapPath("test.html"),System.Text.Encoding.UTF8)
    NN> ; tran.Transform(xmlDoc,
    NN>
    NN> null,w); w.Close();
    NN>
     
    Michael Nemtsev, Jun 7, 2007
    #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. Mark Kamoski
    Replies:
    1
    Views:
    2,453
  2. Ros@
    Replies:
    3
    Views:
    626
  3. Jay
    Replies:
    2
    Views:
    1,088
  4. Oliver
    Replies:
    0
    Views:
    140
    Oliver
    Sep 14, 2004
  5. Marc

    Security Access, Access Denied

    Marc, Aug 16, 2006, in forum: ASP .Net Security
    Replies:
    0
    Views:
    136
Loading...

Share This Page