Directory.CreateDirectory(Path) does not create the given folder

durwinwilson

New Member
This code is running in a ASP Page. \[code\] try{ DirectoryInfo di = Directory.CreateDirectory(destDir); DirectoryInfo diOut = Directory.CreateDirectory(destDir + "\\output"); if (di.Exists) { ErrorLog(Server.MapPath("Logs/ErrorLog"),"created or existing destDir: " + destDir ); } if (diOut.Exists) { ErrorLog(Server.MapPath("Logs/ErrorLog"),"created or existing outputDir:" + destDir +"\\output" ); } } catch(Exception e) { ErrorLog(Server.MapPath("Logs/ErrorLog"),"caught error: " + e.ToString() ); }\[/code\]The value of dst dir is :d:\foo-server\THE\jobgenerator\xmlinput\tmp_JobGenerator_09_08_201216_09_21_718374_THEThe parent folder d:\foo-server\THE\jobgenerator\xmlinput already exists.The log output says that the destDir has been created but when I check the folder I can see that there has been nothing created. The Site is running on a IIS, the configured user has full permission on the parent folder. I dont understand why the di.Exists results in true even if the folder has not been created. Also no Exception will be thrown.Thanks for the help.
 
Back
Top