Current directory for Web Service

Discussion in 'ASP .Net Web Services' started by Alwin D, Jun 12, 2007.

  1. Alwin D

    Alwin D Guest

    Hello,

    How can I get the current directory of Web Service?
    Usually my Web services are under Inetpub directory.

    I would like to write trace file into that place.
    If I try to trace e.g. C:\Temp directory I usually havenät got
    permissions to write the trace file.

    So, do I have special Permissions for wrting trace file from Web Service or
    can I query Web Service's default Assemply location and write there?

    Cheers
     
    Alwin D, Jun 12, 2007
    #1
    1. Advertising

  2. "Alwin D" <> wrote in message
    news:f4md6k$ibl$...
    > Hello,
    >
    > How can I get the current directory of Web Service?
    > Usually my Web services are under Inetpub directory.
    >
    > I would like to write trace file into that place.
    > If I try to trace e.g. C:\Temp directory I usually havenät got
    > permissions to write the trace file.
    >
    > So, do I have special Permissions for wrting trace file from Web Service
    > or
    > can I query Web Service's default Assemply location and write there?


    Please don't cross-post. Post in a single newsgroup.

    Just like any other process, the process running your web service needs
    appropriate permissions to access any file system resource. It does not
    necessarily have any special permissions to the directory its assembly lives
    in.

    You can try Request.PhysicalApplicationPath and see if that works for you.
    You then have to make sure you have rights to write there.
    --
    John Saunders [MVP]
     
    John Saunders [MVP], Jun 12, 2007
    #2
    1. Advertising

  3. Alwin D

    Alwin D Guest

    Some typos from keyboard ...
    But code

    string AppPath = HttpContext.Current.Request.PhysicalApplicationPath;

    works well,

    Cheers

    "John Saunders [MVP]" <john.saunders at trizetto.com> wrote in message
    news:...
    > "Alwin D" <> wrote in message
    > news:f4md6k$ibl$...
    >> Hello,
    >>
    >> How can I get the current directory of Web Service?
    >> Usually my Web services are under Inetpub directory.
    >>
    >> I would like to write trace file into that place.
    >> If I try to trace e.g. C:\Temp directory I usually havenät got
    >> permissions to write the trace file.
    >>
    >> So, do I have special Permissions for wrting trace file from Web Service
    >> or
    >> can I query Web Service's default Assemply location and write there?

    >
    > Please don't cross-post. Post in a single newsgroup.
    >
    > Just like any other process, the process running your web service needs
    > appropriate permissions to access any file system resource. It does not
    > necessarily have any special permissions to the directory its assembly
    > lives in.
    >
    > You can try Request.PhysicalApplicationPath and see if that works for you.
    > You then have to make sure you have rights to write there.
    > --
    > John Saunders [MVP]
    >
    >
     
    Alwin D, Jun 12, 2007
    #3
    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. TPS

    Current web directory changes?

    TPS, Jan 7, 2004, in forum: ASP .Net
    Replies:
    12
    Views:
    782
    Alvin Bruney
    Jan 17, 2004
  2. Alwin D

    Current directory for Web Service

    Alwin D, Jun 12, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    460
    Alwin D
    Jun 12, 2007
  3. ejcosta
    Replies:
    2
    Views:
    885
    Eurico Costa
    Oct 8, 2004
  4. Leo Violette
    Replies:
    0
    Views:
    1,069
    Leo Violette
    Apr 17, 2009
  5. Replies:
    3
    Views:
    408
Loading...

Share This Page