Some typos from keyboard ...
But code
string AppPath = HttpContext.Current.Request.PhysicalApplicationPat h;
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]
>
>
|