How to Get the Working Directory of a WCF Service

I was working on some code today in a WCF service that required me to know the directory containing the service itself. This is one of those things that by the next time I need to do it, I'll be asking myself "How did I do that last time?"

Well, here it is:

System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath;

Comments

Popular posts from this blog

How To Mock Out Child Components In Unit Tests of Angular 2 Code

A Generic Method Using HttpClient to Make a Synchronous Get Request

The Cause and Solution for the "System.Runtime.Serialization.InvalidDataContractException: Type 'System.Threading.Tasks.Task`1[YourTypeHere]' cannot be serialized." Exception