views:

120

answers:

1

I am trying to change the name of a c# WCF logfile based on the name of the IIS Virtual directory it is deployed to.

I tried to use the Directory.GetCurrentDirectory() call but it returns the directory c:\windows\system32\inetsrv regardless which virtual directory the WCF apps was deployed to..

So should I be looking into the VirtualDirectory Class ?? Any sample code on how to find the current Virtual Directory ?

Thanks !

+1  A: 

Did you try this:

string path = HostingEnvironment.MapPath("~"); 
dcp
Thank you very much ! The HostEnvironment.MapPath("~"); gave me exactly what I need !!!
Benjamin