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

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

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

How to Determine if a Column Exists in a DataReader

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

Fixing the "Please add a @Pipe/@Directive/@Component annotation" Error In An Angular App After Upgrading to webpack 4