I'm implementing a web method inside an ASP.NET page to execute asynchronous calls. Now I need to know the physical application path of my web app.
I usually use Request.PhysicalApplicationPath
, but how can I obtain the same information from inside a web method?
NOTE No Request
or Server
properties are available inside the web method...
I've always used:
var rootPath = HostingEnvironment.ApplicationPhysicalPath;
you'll need to also add using System.Web.Hosting;
in your class directives header
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With