i have a log file which needs to be written to the server . If i had the code in a code behind file for a web form i would have done this
File.WriteAllText(Server.MapPath("/ErrorLogFile/ErrorLogFile.log"),json);
Now, since my code sits inside the App_Code folder i have no access to the Server class …so i have to tell it to go find the folder and then write it to the disk. I can accomplish this by telling it the full path and it will work . but i want to tell it to go look for the ErrorLogFolder in the directory you are in and then write the file there . Is there a way to do that ?
System.Web namespace, HttpContext exposes the same functionality from your “code” files.