Thursday, November 1, 2012

Get the WCF current directory

A wcf service is running and hosted by IIS. I have the requirment to get the current folder of the serivce.  And it will return NULL if use HttpContext.Current.Server.MapPath since wcf context is diffrent from the default asp.net context.

what we can do is using,
System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath;

No comments: