c# - How to retrieve physical path for virtual directory -


i have wcf web service deployed in iis 7. when error occurs need log message caused error. log needs created on network share developers have access share (as not have access server service deployed). virtual directory created in iis physical path on network share.

how can physical path of virtual directory? have tried using

system.web.hosting.hostingenvironment.mappath(virtualdirectorypath) 

but returns physical path on server service located.

for example, if virtual directory "wslogs" , give virtualdirectorypath "~/wslogs" c:\inetpub\wwwroot\myservicedirectory\wslogs\

the virtual directory created @ same level (under default web site node) web service. after moving virtual directory located under web service node itself, able physical path virtual directory using:

system.web.hosting.hostingenvironment.mappath(virtualdirectorypath) 

where virtualdirectorypath ~/wslogs


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -