Many times, you need to use a relative path (Server.MapPath), but in classes, you can’t use it directly. You need to use the namespace in which it resides.

But this is easily resolved using the System.Web Namespace:

HttpContext.Current.Server.MapPath()