Sometimes you might need to know where your application is running, for instance if you want to open a file relative to that position. With desktop apps this is more straightforward but web applications run within IIS and any attempt to navigate to a relative path will fail because you start out within a directory from the IIS webserver.
Here is quick way to find out where you're application is running:
public static string GetFullApplicationPath()
{
return HttpRuntime.AppDomainAppVirtualPath != null ? HttpRuntime.AppDomainAppPath : Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
}