How to get the absolute path to a website file from a WCF service hosted in IIS?

How to determine the absolute path to the WCF service root folder file hosted in IIS?

I explored System.ServiceModel.OperationContextand discovered various relative URI paths, but not absolute paths that contain the service root folder.

+3
source share
1 answer

After a little search in the .NET environment, I found:

System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath

This gets the physical path on the disk to the application directory, that is, in the case of the WCF service hosted from IIS, the absolute path to the file folder of the virtual folder.

+5
source

Source: https://habr.com/ru/post/1728121/


All Articles