How do I resolve paths relative to an ASP.NET MVC 4 application's root directory? That is, I want to open files belonging to the application from controller actions, referenced like ~/Data/data.html
. These paths are typically specified in Web.config
.
EDIT:
By 'resolve' I mean to transform a path relative to the application's root directory to an absolute path, .e.g. ~/Data/data.html
→ C:\App\Data\Data.html
.