Directory.CreateDirectory and System.IO.DirectoryNotFoundException January 03 2005
I have been having some fun trying to create directories from ASP.NET Virtual Server directories. The problem was that everytime I tried to create the directory such as:
Directory.CreateDirectory(Server.MapPath(”test_dir”))
I would receive an exception such as:
System.IO.DirectoryNotFoundException: Could not find a part of the path “D:”.
What was happening here was that the webroot was located off of the D: drive and the IIS group did not have “List” or “Read” permissions to the root of the D: drive. Once the permissions were set, I had no problem creating directories.
Hope this helps anyone out there pulling out their hair!
- Posted in : .NET
- Author : site admin

Comments
Sorry comments are closed for this entry