How to Get the Physical Path of an ASP.NET Application

This is one of those things I do infrequently enough that every time I need to, I ask myself "Now how do I do that again?". So I'm posting this here not only to help anyone else who needs to do this, but also to be able to easily remind myself how next time I need to.

To get the physical path of an ASP.NET application, you can use:
HttpContext.Current.Request.PhysicalApplicationPath

Comments

Popular Posts

How to Get Norton Security Suite Firewall to Allow Remote Desktop Connections in Windows

The Cause and Solution for the "System.Runtime.Serialization.InvalidDataContractException: Type 'System.Threading.Tasks.Task`1[YourTypeHere]' cannot be serialized." Exception

Resolving the "n timer(s) still in the queue" Error In Angular Unit Tests

How to Determine if a Column Exists in a DataReader

Setting Default Values in an Angular Reactive Form