tags:

views:

49

answers:

2

I have a WCF service that is responsible for writing a log file. I would like to write a log file relative to the location of my WCF service. This service does NOT have an HttpContext available. Because of this, I cannot use HttpContext.Current.Server.MapPath.

How can I get the location of where my WCF service is running so that I can create a log file?

+1  A: 

Did you try using System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath property of the HostingEnvironment Class?

kzen
A: 

Try Environment.CurrentDirectory

Partha Choudhury