c# - Server.MapPath() returning a path that does not exist when used with DirectoryInfo -


I have virtual directory setup in IIS6 This map on a shared network drive

I correctly

path can be mapped by using string mappath = HttpContext.Current.Server.MapPath (path);

I am then creating DirectoryInfo object because I want to find some files in the directory.

directoryInfo update directory = new directoryinfo (map-path);

But then the update directory. Axis is incorrect ?? I can move the string from mappedPath and can be copied to start in the path-> part, so I know that it exists, I use the integrated windows authentication for the webservice Certifying and permitting for required folders.

Is there something obvious that I'm missing in the code? Or is it a complete set-up and configuration of IIS etc?

According to this link:

Server.mappath does not produce expected output when used against virtual directories.

If this server is allowed and you are using Windows authentication, make sure that you have it in your config:

  & lt; Identification impersonation = "true" />  

The directory incorrectly returns error on the error: if the folder is not there; You do not have permission; Or is it a disconnected network folder.

I am allowed to process your ASP.Net Worker - Impersonation will solve this.


Comments