In one program I am
String filesaveLocation = null;
filesaveLocation = ConfigurationSettings.AppSettings["FileLocation"] + "\\" + Format_Date + "\\";
if (Directory.Exists(filesaveLocation))
The above works.
In the other program I am using
< add key="FileLocation" value="D:App\\Staging" />
< /appSettings>
String filesaveLocation = null;
filesaveLocation = ConfigurationSettings.AppSettings["FileLocation"] + "\\" + Format_Date + "\\";
if (Directory.Exists(filesaveLocation))
this works fine on my windows 7 workstattion.
However when I move the code to a production server, the code does not work.
Do I need to have the '\\" in the directory path set to a different value?
Thus can you tell me what you think could be going wrong and show me code on how to solve the problem?
VulpesPosted Jan 29, 2013, 10:51 AM
If you stick to using single backslashes in local file paths in appSettings, then it should always work OK regardless of operating system: