urgent help needed, Server.MapPath() works differently on server than on development machine

P

Peter Row

Hi,

BACKGROUND:
Win2K Server SP4, ASP.NET 1.1
Win2K Pro SP4, ASP.NET 1.1
I have a wrapper class around all the asp objects.

Website physical directory structure (phoney names)
Server:
C:\MySite
|_ _Settings
|_ Root
|_ Bin (contains the DLL)
|_ XSL

Development test machine
C:\TestSite
|_ _Settings
|_ Root
|_ Bin (contains the DLL)
|_ XSL

In both cases ParentPaths are enabled. In IIS the sites directory is set
to C:\MySite\Root and
C:\TestSite\Root respectively.

I read in the settings file from the _Settings directory; working out the
physical path with:

Directory.GetParent(Asp.Server.MapPath("/")).FullName & "\"

For some bizarre reason on the server this results in:
C:\MySite\Root\_Settings

....but correctly on the development machine:
C:\MySite\_Settings

I have tried saying:
Asp.Server.MapPath("~")
.... instead, again, this works on the development machine but not on the
server.

The only difference as far as I can see is that the server site has it's own
URL
where as the development machine has a virtual root.

This project is a port from a VB6/ASP app which worked fine with the same
code
as above.

I think for some weird reason when running on the server it is somehow
getting the
"Bin" directory hence why the above is returned on the server. But I have
tested
it on my development machine against the compiled DLL and it still works
even then.

Any ideas as to what is going on would be most appreciated.

Regards,
Peter Row
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top