How to get working path of a wcf application?

I needed the same information for my IIS6 hosted WCF application and I found that this worked for me:

string apPath = System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath;

As always, YMMV.

Leave a Comment