How to get the path that usually looks like %SystemDrive%\inetpub\wwwroot ?
I guess it’s something to do with Microsoft.Web.Administration.ServerManager class, but I couldn’t find a way.
Update: I’m trying to get the path from standalone app. Not an ASP.NET web app.
To discover the physical path of a website from a standalone application you can do the following:
If you’re using IIS 6 (or the IIS6 admin compatibility layer for IIS7)
Both these examples demonstrate how to discover the path to the root of a Web Site.
To discover the path to a virtual directory you need to amend the paths as necessary.