image

Universal Relative to Physical Path Converter for Windows Forms / ASP.NET / WPF / Console Apps

July 14, 2009
The .NET Framework does not provide standard functionality for resolving a path relative to the application root to a physical file system path. Thus in ASP.NET Web applications we need to use Server.MapPath(), but in console and Windows Forms / WPF applications we need to rely on the current directory. Moreover if we run a