You can find the documentation for the HttpContext class and it tells you that it is in the System.Web , in System.Web.dll .
So, to use it, you need a link to the System.Web.dll library, and you need either the using System.Web; statement using System.Web; , or use the full name System.Web.HttpContext.Current.Server.MapPath .
However, are you sure you want to use the MapPath method? The method gets the physical path to the web link to the file. If the path to the CSV file is a web link, for example, "/data/items.csv" , then you want to use the MapPath method, but if you have a physical path, for example, "C:\mydata\items.csv" , then you don't want to convert it.
In addition, MapPath only works if you are actually in a web application that has an HTTP context.
Guffa
source share