having a big of an issue with with Server.MapPath in that I can't get it to resolve from server and unsure how to test what it's trying to do.
Locally, it works fine in a whole variety of different ways, but when I put it up to the server, each and everyone one of them fails.
string filename = "TestLog.txt";
string path = Path.Combine(Server.MapPath("~/Content/"), filename);
Debug.WriteLine(path)
using (System.IO.StreamWriter writer = new System.IO.StreamWriter(path, true))
{
writer.WriteLine(message);
writer.Close();
}
I've tried /content in the path and adding the extra / into the filename. Have tried with and without the tilda. They all resolve the path correctly locally but not on the server.
For the record, the path I am trying to access is
Local: C:\Users\username\Documents\MyWebSite\Web\Content\TestLog.txt Server: D:\Web\MyWebSite\Content\TestLog.txt
With MyWebSite\Web being the root of the site locally MyWebSite being the root on server, so mywebsite.com/content/TestLog.txt
Any help at all is greatly appreciated.