tags:

views:

116

answers:

1

How can one determine the absolute filepath of the WCF service root folder that's hosted in IIS?

I've investigated System.ServiceModel.OperationContext and discovered various relative URI paths, but no absolute paths that contain the service root folder.

A: 

After a little digging around the .NET framework I discovered:

System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath

This gets the physical path on disk to the application's directory, i.e. in the case of a WCF service hosted from IIS, the virtual folder's absolute file path.

Simon Brangwin