As we know that a virtual direcoty can be linked to a folder with a diffrent name, how can I get the physical path of a virtual directory ?
I've been trying with HttpContext.Current.server.MapPath but it returns me the physic path plus the path I send in parameter even if the directory doesn't even exist or if it exists with a diffrent name.
Exemple :
C:\blabla\Sites\Application1\Imaageesss - On disc
Application1\Images (In ISS, my virutal directory)
But if I do a MapPath on "/Images" it will never give me C:\blabla\Sites\Application1\Imaageesss but C:\inetpub\wwwroot\Images which is not the real directory linked to.
Server.MapPath("/Application1/Images/image.jpg")instead ofServer.MapPath("/Images/image.jpg")in one situation, and the other it just turned out I mis-referenced my virtual directory name within my application. I had the same result the OP was experiencing until I did each of these things. Just thought I'd add on... - ionalchemist