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

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

How to Determine if a Column Exists in a DataReader

Silent Renew and the "login_required" Error When Using oidc-client

Unit Testing with a Mock Entity Framework DbContext and Fake DbSets