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

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

How to Get Norton Security Suite Firewall to Allow Remote Desktop Connections in Windows

How to Determine if a Column Exists in a DataReader

Resolving the "n timer(s) still in the queue" Error In Angular Unit Tests

Setting Default Values in an Angular Reactive Form