Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > urgent help needed, Server.MapPath() works differently on server than on development machine

Thread Tools

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

Peter Row
Posts: n/a

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)
|_ _Settings
|_ Root
|_ Bin (contains the DLL)
|_ XSL

Development test machine
|_ _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:

....but correctly on the development machine:

I have tried saying:
.... instead, again, this works on the development machine but not on the

The only difference as far as I can see is that the server site has it's own
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
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
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.

Peter Row

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
"constant sharing" works differently in REPL than in script ? Python 4 06-19-2012 09:44 PM
url mapping works differently in Cassini than in IIS?? Les Caudle ASP .Net 2 09-19-2006 04:53 PM
Server.MapPath() works differently on IIS 6.0 compared to IIS 5.0 Elie Grouchko ASP General 7 01-04-2005 10:52 AM
Server.MapPath() works differently on 2 different machines, ideas? Peter Row ASP .Net 0 02-23-2004 01:47 PM
<SELECT OnChange=foo()> works differently in NS 7 than in other browsers Steven Kan Javascript 0 08-19-2003 07:52 PM