I'm building a console app under .NET Core (Version netcoreapp2.1) on macOS.
I check at the beginning of a method whether the file in question exists:
if (!File.Exists(filePath))
{
Log.Error(string.Format("File not found: {0}", filePath));
return null;
}
filePath
contains the absolute path of the file e.g. "/Users/myusername/Desktop/recipients.csv"
and the file sits on my desktop. But when I debug, I see that the program does not see the file.
I have also tried the following string variations to no avail.
"//Users//myusername//Desktop//recipients.csv"
@"/Users/myusername/Desktop/recipients.csv"
This might be a very simple problem. But it has now taken about an hour.