在wcf服务中获取文件的物理路径

问题描述:

Server.mappath在wcf中不工作?在IIS中获取文件物理位置的替代方法是什么?在wcf服务中获取文件的物理路径

最佳回答了这一主题:How to get working path of a wcf application?

基本上,用它来获取工作目录:

System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath 
+0

你知道,如果这仍然有效,2017年?在我的引用中找不到System.Web.Hosting。 – Dragomok 2017-01-10 11:04:35

+1

也许你没有引用System.Web?请参阅http://stackoverflow.com/questions/26236721/cant-add-reference-to-system-web-hosting – Alex 2017-01-12 19:32:25