That's strange.
I can retrieve physical paths by using Server.MapPath("/virtualDir")
without any problem.
mappath.aspx:
----------------
<%@ Page Language="VB" %>
<script language = "VB" runat = "server">
Sub Page_Load(ByVal obj As Object, ByVal e As EventArgs)
Dim x As String = Server.MapPath("/SomeApp")
Label1.Text = "The physical directory for /SomeApp is : " & x
End Sub
</script>
<html>
<head runat="server">
<title>Server.MapPath</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server"></asp:Label><br/>
</div>
</form>
</body>
</html>
----------------
Juan T. Llibre, asp.net MVP
aspnetfaq.com :
http://www.aspnetfaq.com/
asp.net faq :
http://asp.net.do/faq/
foros de asp.net, en español :
http://asp.net.do/foros/
===================================
"benoit" <be****@discussions.microsoft.com> wrote in message
news:DF**********************************@microsof t.com...
Well
On ASP.NET 1.1 I had two webapps on the same server
/WNW
and
/Data
/Data was a virtual folder in which images and Xml are stored.
With Server.MapPath("/Data") i could without any problem read my Xml and
images.
Since I made the move to ASP.Net 2.0, I am no longer able to retrieve my
data the way I used to
"Peter Bromberg [C# MVP]" wrote:
Benoit,
Server.MapPath(...) works starting at the IIS Virtual directory root of the
currently running application page.
It does not work for folders anywhere outside the IIS Vroot of the current
application.
What is it that you are trying to accomplish?
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"benoit" wrote:
> Hi,
>
> if I write this code to retrieve a folder on the server
> Server.mappath("/DATA")
>
> I get this error message
> System.InvalidOperationException: Failed to map the path '/DATA'
>
> the virtual folder for my webApp is not situated in Inetpub, nor is the DATA
> folder that I would like to retrieve
>
> anybody an idea
>
> thx