By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,812 Members | 875 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,812 IT Pros & Developers. It's quick & easy.

MapPath Strange behavior locally

P: n/a
hi all,

i've a legacy ASP.NTT code that works fine, but now i'm trying to add new
feature

so i get the files from our source safe and put them in "d:\Projects\mySite"

and created a new virtual directory for it and make it point to the project
Directory

, till now every thing is ok,

the problem is that Server.MapPath("/") returns "c:\inetpub\wwwroot" ???

i dont know why, while it works fine on site

i'm running IIS 5 on win2000 pro

thanks,

with my best regards
Nov 18 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
That is expected behavior. / is the root of your site, regardless of where
you are, so when that path is translated to the file system, it is where the
root of your site is. This is C:\Inetpub\wwwroot in a default
configuration.

../ would work for you.

Ray at work

"Ahmed El Lakani" <a@hotmail.com> wrote in message
news:Ol**************@TK2MSFTNGP10.phx.gbl...
hi all,

i've a legacy ASP.NTT code that works fine, but now i'm trying to add new
feature

so i get the files from our source safe and put them in "d:\Projects\mySite"
and created a new virtual directory for it and make it point to the project Directory

, till now every thing is ok,

the problem is that Server.MapPath("/") returns "c:\inetpub\wwwroot" ???

i dont know why, while it works fine on site

i'm running IIS 5 on win2000 pro

thanks,

with my best regards

Nov 18 '05 #2

P: n/a
Thanks Ray,

mmmm, but how it was installed on hosting machine ????
is this mean that its installed on the root ????, or some thing that isn't
avilable on win2000 pro
if that, so how i'm going to change it to work on both sides ??? my pc and
the host ?

"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
message news:#1**************@TK2MSFTNGP10.phx.gbl...
That is expected behavior. / is the root of your site, regardless of where you are, so when that path is translated to the file system, it is where the root of your site is. This is C:\Inetpub\wwwroot in a default
configuration.

./ would work for you.

Ray at work

"Ahmed El Lakani" <a@hotmail.com> wrote in message
news:Ol**************@TK2MSFTNGP10.phx.gbl...
hi all,

i've a legacy ASP.NTT code that works fine, but now i'm trying to add new feature

so i get the files from our source safe and put them in

"d:\Projects\mySite"

and created a new virtual directory for it and make it point to the

project
Directory

, till now every thing is ok,

the problem is that Server.MapPath("/") returns "c:\inetpub\wwwroot" ???

i dont know why, while it works fine on site

i'm running IIS 5 on win2000 pro

thanks,

with my best regards


Nov 18 '05 #3

P: n/a
I don't really understand your questions or what the issue is. Can you
rexplain or explain what's not working for you?

Ray at work

"Ahmed El Lakani" <a@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Thanks Ray,

mmmm, but how it was installed on hosting machine ????
is this mean that its installed on the root ????, or some thing that isn't
avilable on win2000 pro
if that, so how i'm going to change it to work on both sides ??? my pc and
the host ?

"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
message news:#1**************@TK2MSFTNGP10.phx.gbl...
That is expected behavior. / is the root of your site, regardless of

where
you are, so when that path is translated to the file system, it is where

the
root of your site is. This is C:\Inetpub\wwwroot in a default
configuration.

./ would work for you.

Ray at work

"Ahmed El Lakani" <a@hotmail.com> wrote in message
news:Ol**************@TK2MSFTNGP10.phx.gbl...
hi all,

i've a legacy ASP.NTT code that works fine, but now i'm trying to add new feature

so i get the files from our source safe and put them in

"d:\Projects\mySite"

and created a new virtual directory for it and make it point to the

project
Directory

, till now every thing is ok,

the problem is that Server.MapPath("/") returns "c:\inetpub\wwwroot" ???
i dont know why, while it works fine on site

i'm running IIS 5 on win2000 pro

thanks,

with my best regards



Nov 18 '05 #4

P: n/a
i'm just asking on how to change the call to MapPath
to make it machine independent and also path independent ????

Thanks for your help

"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
message news:e8**************@TK2MSFTNGP10.phx.gbl...
I don't really understand your questions or what the issue is. Can you
rexplain or explain what's not working for you?

Ray at work

"Ahmed El Lakani" <a@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Thanks Ray,

mmmm, but how it was installed on hosting machine ????
is this mean that its installed on the root ????, or some thing that isn't
avilable on win2000 pro
if that, so how i'm going to change it to work on both sides ??? my pc and the host ?

"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
message news:#1**************@TK2MSFTNGP10.phx.gbl...
That is expected behavior. / is the root of your site, regardless of

where
you are, so when that path is translated to the file system, it is
where the
root of your site is. This is C:\Inetpub\wwwroot in a default
configuration.

./ would work for you.

Ray at work

"Ahmed El Lakani" <a@hotmail.com> wrote in message
news:Ol**************@TK2MSFTNGP10.phx.gbl...
> hi all,
>
> i've a legacy ASP.NTT code that works fine, but now i'm trying to
add new
> feature
>
> so i get the files from our source safe and put them in
"d:\Projects\mySite"
>
> and created a new virtual directory for it and make it point to the
project
> Directory
>
> , till now every thing is ok,
>
> the problem is that Server.MapPath("/") returns "c:\inetpub\wwwroot"

??? >
> i dont know why, while it works fine on site
>
> i'm running IIS 5 on win2000 pro
>
> thanks,
>
> with my best regards
>
>



Nov 18 '05 #5

P: n/a
As stated by Ray Server.MapPath ("./") which is the path of the current
directory.

Server.MapPath("/") is the path of the root directory for the site. Your web
application could be anywhere under the root such as
c:\root\external\yourname\yourapp and it can't be machine independant.

Server.MapPath("~/") will give you the root of your application
(c:\root\external\yourname\yourapp) while Server.mapPath("/") will give
c:\root.

Patrice

"Ahmed El Lakani" <a@hotmail.com> a écrit dans le message de
news:%2****************@TK2MSFTNGP09.phx.gbl...
i'm just asking on how to change the call to MapPath
to make it machine independent and also path independent ????

Thanks for your help

"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
message news:e8**************@TK2MSFTNGP10.phx.gbl...
I don't really understand your questions or what the issue is. Can you
rexplain or explain what's not working for you?

Ray at work

"Ahmed El Lakani" <a@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Thanks Ray,

mmmm, but how it was installed on hosting machine ????
is this mean that its installed on the root ????, or some thing that isn't avilable on win2000 pro
if that, so how i'm going to change it to work on both sides ??? my pc and the host ?

"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
message news:#1**************@TK2MSFTNGP10.phx.gbl...
> That is expected behavior. / is the root of your site, regardless of where
> you are, so when that path is translated to the file system, it is where the
> root of your site is. This is C:\Inetpub\wwwroot in a default
> configuration.
>
> ./ would work for you.
>
> Ray at work
>
> "Ahmed El Lakani" <a@hotmail.com> wrote in message
> news:Ol**************@TK2MSFTNGP10.phx.gbl...
> > hi all,
> >
> > i've a legacy ASP.NTT code that works fine, but now i'm trying to add new
> > feature
> >
> > so i get the files from our source safe and put them in
> "d:\Projects\mySite"
> >
> > and created a new virtual directory for it and make it point to the > project
> > Directory
> >
> > , till now every thing is ok,
> >
> > the problem is that Server.MapPath("/") returns
"c:\inetpub\wwwroot" ???
> >
> > i dont know why, while it works fine on site
> >
> > i'm running IIS 5 on win2000 pro
> >
> > thanks,
> >
> > with my best regards
> >
> >
>
>



Nov 18 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.