re:[color=blue]
> Does it have something to do with that?[/color]
Server.MapPath returns the correct physical directory regardless of whether
you use the built-in server in the VS IDE, or whether you use IIS to view the page.
All it needs is a valid relative URL ( a virtual path ).
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" <benoit@discussions.microsoft.com> wrote in message
news:932A4245-78F3-403C-BCDE-CC1110C31B94@microsoft.com...[color=blue]
>I noticed that when i teste the app in the past the address
> was
http://localhost/MyApp/...
> and now
http://localhost:someport/MyApp
>
> Does it have something to do with that?[/color]
[color=blue]
> "Juan T. Llibre" wrote:
>[color=green]
>> 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" <benoit@discussions.microsoft.com> wrote in message
>> news:DFDBDCA4-291C-437B-96C8-9C7DD43B7A18@microsoft.com...[color=darkred]
>> > 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[/color]
>>
>>
>>[/color][/color]