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
Post a Comment