Rahul Kumar Saxena

Rahul Kumar Saxena

  • 30
  • 40.4k
  • 18.3m

Failed To Map the Path( / )

Feb 18 2008 4:30 AM

If we use  Server.MapPath("..") in ASP.NET 2.0  Then It Gives a error

System.InvalidOperationException: "Failed to map the path '/'"

In ASP.Net 1.x, Server.MapPath("..") works fine in the older versions.
The newer version does not support ".." and it is recommended to use "~" instead. For e.g.:

Server.MapPath("~/Path");


Answers (1)