Here is how I do it:
HttpContext.Current.Server.MapPath(@\"~\\~\\~\\Content\\\")
HI know that \'.\' is for the root of the project, but how
Start with the root of your site with ~
and specify the full path: ~/Archive/Content
.
You can't go back above site root because of security restrictions, see also this article from other solutions.
IIS purposefully prevents serving up content directly that is outside of the site path. However, you can create a virtual directory in IIS and have ISAPI Rewrite point to that. For example, create a virtual directory called /staticfiles that points to c:\test\data\static-files. As far as IIS is concerned, that's directly off of the root of the site in a folder called /staticfiles.