Server.mappath is not working in wcf? what is the alternate way to get the physical location of the file in IIS.?
Asked
Active
Viewed 8,740 times
1 Answers
7
Best answered in this thread: How to get working path of a wcf application?
Basically, use this to get the working directory:
System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath
-
Do you know if this still works as of 2017? I can't find System.Web.Hosting in my references. – Dragomok Jan 10 '17 at 11:04
-
1Perhaps you are not referencing System.Web? See http://stackoverflow.com/questions/26236721/cant-add-reference-to-system-web-hosting – Alex Jan 12 '17 at 19:32