Rahul Kumar Saxena

Rahul Kumar Saxena

  • Tech Writer
  • 29.5k
  • 18.6m

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)